
public class IncrementableList<Item extends Incrementable> {
	private class Node {
		Item value;
		Node next;

		Node(Item theValue, Node theNext) {
			value = theValue;
			next = theNext;
		}
	}

	Node head = null;
	
	public void add (Item value) {
		head = new Node (value, head);
	}

	public String toString () {
		String ret="";
		for (Node p = head; p!=null; p=p.next)
			ret += p.value+" ";
		return ret;
	}
	
	public void incrementAll() {
		for (Node p = head; p!=null; p=p.next) {
			p.value.increment();
		}
	}
}
