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 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 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(); } } }