Skip to content

Commit

Permalink
#6237 Specified list implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
michalgce committed Nov 8, 2017
1 parent f208361 commit fb1024e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,18 @@ public AbstractChart setYBound(double lower, double upper) {
return this;
}

public AbstractChart setYBound(List bound) {
public AbstractChart setYBound(List<Number> bound) {
if (bound.size() != 2) {
throw new IllegalArgumentException("to set the y bound, the list needs to be of size=2");
}
if (!(bound.get(0) instanceof Number) || !(bound.get(1) instanceof Number)) {
throw new IllegalArgumentException("the elements in the list needs to be numbers");
}
Number n0 = (Number) bound.get(0);
Number n1 = (Number) bound.get(1);

Number n0 = bound.get(0);
Number n1 = bound.get(1);
setYBound(n0.doubleValue(), n1.doubleValue());
return this;
}

public AbstractChart setyBound(List bound) {
public AbstractChart setyBound(List<Number> bound) {
return this.setYBound(bound);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,18 @@ public XYChart setXBound(double lower, double upper) {
return this;
}

public XYChart setXBound(List bound) {
public XYChart setXBound(List<Number> bound) {
if (bound.size() != 2) {
throw new IllegalArgumentException("to set the x bound, the list needs to be of size=2");
}
if (!(bound.get(0) instanceof Number) || !(bound.get(1) instanceof Number)) {
throw new IllegalArgumentException("the elements in the list needs to be numbers");
}
Number n0 = (Number) bound.get(0);
Number n1 = (Number) bound.get(1);

Number n0 = bound.get(0);
Number n1 = bound.get(1);
setXBound(n0.doubleValue(), n1.doubleValue());
return this;
}

public XYChart setxBound(List bound) {
public XYChart setxBound(List<Number> bound) {
return this.setXBound(bound);
}

Expand Down

0 comments on commit fb1024e

Please sign in to comment.