private Iterator(FourColorTree<E> tree) { this.tree = tree; this.treeIterator = new FourColorTreeIterator<E>(tree); }
public int getType() { byte color = treeIterator.color(); if(color == INSERT) return ListEvent.INSERT; else if(color == UPDATE) return ListEvent.UPDATE; else if(color == DELETE) return ListEvent.DELETE; else throw new IllegalStateException(); } public boolean next() {
public boolean hasNext() { return treeIterator.hasNext(CHANGE_INDICES); } public boolean hasNextNode() {
public int getIndex() { return treeIterator.index(TARGET_INDICES); } public int getEndIndex() {
public boolean hasNextNode() { return treeIterator.hasNextNode(CHANGE_INDICES); }
public boolean nextNode() { if(!hasNextNode()) return false; treeIterator.nextNode(CHANGE_INDICES); return true; } public boolean hasNext() {
public boolean next() { if(!hasNext()) return false; treeIterator.next(CHANGE_INDICES); return true; } public boolean nextNode() {
/** * @return <code>true</code> if there's a node of the specified color in this * tree following the current node. */ public boolean hasNextNode( byte colors ) { if(node == null) { return tree.size( colors ) > 0; } else { return nodeEndIndex( colors ) < tree.size( colors ); } }
public E getOldValue() { return treeIterator.node().get(); } }
public Iterator<E> copy() { return new Iterator<E>(tree, treeIterator.copy()); }
public int getIndex() { return treeIterator.index(TARGET_INDICES); } public int getEndIndex() {
public boolean hasNextNode() { return treeIterator.hasNextNode(CHANGE_INDICES); }
public boolean nextNode() { if(!hasNextNode()) return false; treeIterator.nextNode(CHANGE_INDICES); return true; } public boolean hasNext() {
public boolean next() { if(!hasNext()) return false; treeIterator.next(CHANGE_INDICES); return true; } public boolean nextNode() {
/** * @return <code>true</code> if there's a node of the specified color in this * tree following the current node. */ public boolean hasNextNode( byte colors ) { if(node == null) { return tree.size( colors ) > 0; } else { return nodeEndIndex( colors ) < tree.size( colors ); } }
public E getOldValue() { return treeIterator.node().get(); } }
public Iterator<E> copy() { return new Iterator<E>(tree, treeIterator.copy()); }
public boolean hasNext() { return treeIterator.hasNext(CHANGE_INDICES); } public boolean hasNextNode() {
private Iterator(FourColorTree<E> tree) { this.tree = tree; this.treeIterator = new FourColorTreeIterator<E>(tree); }
public int getIndex() { return treeIterator.index(TARGET_INDICES); } public int getEndIndex() {