//: c17:doubledispatch:DDPaper.java // From Thinking in Java, 2nd Edition // Available at http://www.BruceEckel.com // (c) Bruce Eckel 1999 // Copyright notice in Copyright.txt // Paper for double dispatching package c17.doubledispatch; import c17.trash.*; public class DDPaper extends Paper implements TypedBinMember { public DDPaper(double wt) { super(wt); } public boolean addToBin(TypedBin[] tb) { for(int i = 0; i < tb.length; i++) if(tb[i].add(this)) return true; return false; } } ///:~