View Javadoc

1   package cz.cuni.amis.utils.heap;
2   
3   import java.util.Iterator;
4   
5   import cz.cuni.amis.utils.NullCheck;
6   
7   public class HeapImmutableIterator<NODE> implements Iterator<NODE> {
8   
9   	private Iterator<NODE> iter;
10  
11  	public HeapImmutableIterator(Iterator<NODE> iter) {
12  		this.iter = iter;
13  		NullCheck.check(this.iter, "iter");
14  	}
15  	
16  	@Override
17  	public boolean hasNext() {
18  		return iter.hasNext();
19  	}
20  
21  	@Override
22  	public NODE next() {
23  		return iter.next();
24  	}
25  
26  	@Override
27  	public void remove() {
28  		throw new UnsupportedOperationException("ImmutableHeapIterator, can't remove!");
29  	}
30  
31  }