11ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabotpackage org.hamcrest.internal;
21ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
31ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabotimport java.util.Iterator;
41ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
51ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabotimport org.hamcrest.SelfDescribing;
61ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
71ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabotpublic class SelfDescribingValueIterator<T> implements Iterator<SelfDescribing> {
81ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    private Iterator<T> values;
91ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
101ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    public SelfDescribingValueIterator(Iterator<T> values) {
111ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot        this.values = values;
121ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    }
131ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
141ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    public boolean hasNext() {
151ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot        return values.hasNext();
161ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    }
171ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
181ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    public SelfDescribing next() {
191ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot        return new SelfDescribingValue<T>(values.next());
201ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    }
211ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot
221ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    public void remove() {
231ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot        values.remove();
241ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot    }
251ecfda91236a8970119144e59e0ba6113dc22c0fBrett Chabot}
26