org.embl.ebi.escience.baclava.iterator
Class LockStepIteratorNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.embl.ebi.escience.baclava.iterator.LockStepIteratorNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Iterator, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode, ResumableIterator

public class LockStepIteratorNode
extends javax.swing.tree.DefaultMutableTreeNode
implements ResumableIterator

A DefaultMutableTreeNode implementing ResumableIterator which wraps a LockStepIterator.

Author:
Tom Oinn
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
LockStepIteratorNode()
          Create a new LockStepIteratorNode, calls to insert(...) will add iterators to the dot product.
 
Method Summary
 boolean getAllowsChildren()
          LockStepIteratorNode objects pull iterators from their children, therefore always allow them.
 int[] getCurrentLocation()
          Get the current location
 boolean hasNext()
          Delegates to contained LockStepIterator
 void insert(javax.swing.tree.MutableTreeNode node, int index)
          Trap any calls to add children and forcibly reset everything
 boolean isLeaf()
          A LockStepIteratorNode requires children to be functional and is therefore never a leaf.
 java.lang.Object next()
          Return a Map of named objects derived from any iterator nodes attached to this one as children, the iteration strategy is derived from the underlying LockStepIterator which performs a cross product of all available sub-iterators
 void remove()
          Calls to the remove operation are not allowed from this iterator
 void reset()
          Delegates to contained LockStepIterator
 int size()
          Delegates to contained LockStepIterator
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LockStepIteratorNode

public LockStepIteratorNode()
Create a new LockStepIteratorNode, calls to insert(...) will add iterators to the dot product.

Method Detail

next

public java.lang.Object next()
Return a Map of named objects derived from any iterator nodes attached to this one as children, the iteration strategy is derived from the underlying LockStepIterator which performs a cross product of all available sub-iterators

Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
Delegates to contained LockStepIterator

Specified by:
hasNext in interface java.util.Iterator

reset

public void reset()
Delegates to contained LockStepIterator

Specified by:
reset in interface ResumableIterator

size

public int size()
Delegates to contained LockStepIterator

Specified by:
size in interface ResumableIterator

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Calls to the remove operation are not allowed from this iterator

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

insert

public void insert(javax.swing.tree.MutableTreeNode node,
                   int index)
Trap any calls to add children and forcibly reset everything

Specified by:
insert in interface javax.swing.tree.MutableTreeNode
Overrides:
insert in class javax.swing.tree.DefaultMutableTreeNode

isLeaf

public boolean isLeaf()
A LockStepIteratorNode requires children to be functional and is therefore never a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode

getAllowsChildren

public boolean getAllowsChildren()
LockStepIteratorNode objects pull iterators from their children, therefore always allow them.

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Overrides:
getAllowsChildren in class javax.swing.tree.DefaultMutableTreeNode

getCurrentLocation

public int[] getCurrentLocation()
Get the current location

Specified by:
getCurrentLocation in interface ResumableIterator