OnJava8-Examples/patterns/trash/FillableList.java

15 lines
340 B
Java
Raw Normal View History

2015-05-06 15:14:33 -07:00
//: patterns/trash/FillableList.java
// Adapter that makes an ArrayList Fillable.
package patterns.trash;
import java.util.*;
2015-05-27 23:30:19 -07:00
public class FillableList<T extends Trash>
implements Fillable<T> {
private ArrayList<T> v;
public FillableList(ArrayList<T> vv) {
2015-05-18 23:05:20 -07:00
v = vv;
}
2015-05-06 15:14:33 -07:00
@Override
2015-05-27 23:30:19 -07:00
public void addTrash(T t) { v.add(t); }
2015-05-06 15:14:33 -07:00
} ///:~