import java.util.ArrayList; /** A piece of paper -- version 1 */ public class Paper1 { private double width, height; private double minUsefulDimension = 3.5; /** Creates a new instance of Paper */ public Paper1(double w, double h) { this.width = w; this.height = h; } /** Decide if a piece of paper is big enough to be useful public boolean isBigEnough() { if (this.width >= minUsefulDimension && /*** POINT X ***/ this.height >= minUsefulDimension) { return true; } else { return false; } } /** Filter to return only the big enough pieces of paper. */ public ArrayList goodPapersOnly(ArrayList all) { ArrayList output = new ArrayList(); java.util.Iterator aIter = all.iterator(); while (aIter.hasNext()) { Paper1 aPiece = (Paper1) aIter.next(); if (aPiece.width >= minUsefulDimension && /*** POINT Y ***/ aPiece.height >= minUsefulDimension) { output.add(aPiece); } } return output; } //end class }