Code example for ArrayDeque

Methods: add

0
import au.com.langdale.kena.ResIterator; 
 
public abstract class TransitiveIterator implements ResIterator { 
 
	private HashSet seen = new HashSet();
	private ArrayDeque queue = new ArrayDeque();
	 
	public TransitiveIterator(OntResource seed) {
		queue.add(seed);
		seen.add(seed);
	} 
 
	public boolean hasNext() { 
		return ! queue.isEmpty();
	} 
 
	public OntResource nextResource() { 
		OntResource r = (OntResource) queue.removeFirst();
		ResIterator it = traverse(r);
		while( it.hasNext()) {
			OntResource s = it.nextResource();