public BigDecimal get_ymin() { BigDecimal ymin = values.get(0).gety(); for (ValuePair pair : values) { if (pair.gety().compareTo(ymin) < 0) { ymin = pair.gety(); } } return ymin; }
public BigDecimal get_ymax() { BigDecimal ymax = values.get(0).gety(); for (ValuePair pair : values) { if (pair.gety().compareTo(ymax) > 0) { ymax = pair.gety(); } } return ymax; }
public void x_truncate(BigDecimal xmin, BigDecimal xmax) { Iterator<ValuePair> iter = this.values.iterator(); while (iter.hasNext()) { ValuePair next = iter.next(); if (next.getx().compareTo(xmin) == -1 || next.getx().compareTo(xmax) == 1) { iter.remove(); } } }
public void y_truncate(BigDecimal ymin, BigDecimal ymax) { Iterator<ValuePair> iter = this.values.iterator(); while (iter.hasNext()) { ValuePair next = iter.next(); if (next.gety().compareTo(ymin) == -1 || next.gety().compareTo(ymax) == 1) { System.out.println("asd: " + next.gety() + ymax); iter.remove(); } } }