2015-05-05 11:20:13 -07:00
|
|
|
//: patterns/doubledispatch/DDAluminum.java
|
|
|
|
// Aluminum for double dispatching.
|
|
|
|
package patterns.doubledispatch;
|
|
|
|
import patterns.trash.*;
|
|
|
|
|
|
|
|
public class DDAluminum extends Aluminum
|
|
|
|
implements TypedBinMember {
|
|
|
|
public DDAluminum(double wt) { super(wt); }
|
|
|
|
@Override
|
|
|
|
public boolean addToBin(TypedBin[] tb) {
|
2015-05-18 23:05:20 -07:00
|
|
|
for(TypedBin tb1 : tb) {
|
|
|
|
if(tb1.add(this)) {
|
2015-05-05 11:20:13 -07:00
|
|
|
return true;
|
2015-05-05 14:05:39 -07:00
|
|
|
}
|
|
|
|
}
|
2015-05-05 11:20:13 -07:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} ///:~
|