OnJava8-Examples/patterns/trash/FillableList.java
Bruce Eckel 88dbdbbbcb update
2015-05-18 23:05:30 -07:00

15 lines
332 B
Java

//: patterns/trash/FillableList.java
// Adapter that makes an ArrayList Fillable.
package patterns.trash;
import java.util.*;
public class FillableList
implements Fillable {
private ArrayList<Trash> v;
public FillableList(ArrayList<Trash> vv) {
v = vv;
}
@Override
public void addTrash(Trash t) { v.add(t); }
} ///:~