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

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

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

A DefaultMutableTreeNode implementing ResumableIterator which wraps a JoinIterator.

Author:
Tom Oinn
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
JoinIteratorNode()
          Create a new JoinIteratorNode, calls to insert(...) will add iterators to the join.
 
Method Summary
 boolean getAllowsChildren()
          JoinIteratorNode objects rely on their children to provide them with objects to iterate over, they do not contain any collections themselves
 int[] getCurrentLocation()
          Return the current location
 boolean hasNext()
          Return true if calls to next() will succeed
 void insert(javax.swing.tree.MutableTreeNode node, int index)
          Trap any calls to add children and forcibly reset everything
 boolean isLeaf()
          JoinIteratorNode objects are never leaves in the tree or at least shouldn't act as such.
 java.lang.Object next()
          Return a Map of named objects derived from any iterator nodes attached to this one as children.
 void remove()
          Calls to the remove operation are not allowed from this iterator
 void reset()
          Reset the underlying JoinIterator
 int size()
          Return the size of the underlying JoinIterator
 
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

JoinIteratorNode

public JoinIteratorNode()
Create a new JoinIteratorNode, calls to insert(...) will add iterators to the join.

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 JoinIterator which performs a cross product or orthoganol join across all the sub-iterators

Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
Return true if calls to next() will succeed

Specified by:
hasNext in interface java.util.Iterator

getCurrentLocation

public int[] getCurrentLocation()
Return the current location

Specified by:
getCurrentLocation in interface ResumableIterator

reset

public void reset()
Reset the underlying JoinIterator

Specified by:
reset in interface ResumableIterator

size

public int size()
Return the size of the underlying JoinIterator

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()
JoinIteratorNode objects are never leaves in the tree or at least shouldn't act as such.

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

getAllowsChildren

public boolean getAllowsChildren()
JoinIteratorNode objects rely on their children to provide them with objects to iterate over, they do not contain any collections themselves

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