org.nuiton.wikitty.search
Class TreeNodeResult<T>

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.nuiton.wikitty.search.TreeNodeResult<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<TreeNodeResult<T>>, MutableTreeNode, TreeNode

public class TreeNodeResult<T>
extends DefaultMutableTreeNode
implements Iterable<TreeNodeResult<T>>

L'iteration se fait en profondeur

Since:
3.1 Last update: $Date$ by : $Author$
Version:
$Revision$
Author:
poussin
See Also:
Serialized Form

Nested Class Summary
static interface TreeNodeResult.Visitor<T>
          Visitor for TreeNodeResult
 
Field Summary
protected  int attCount
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
TreeNodeResult(T object, int attCount)
           
 
Method Summary
 boolean acceptVisitor(TreeNodeResult.Visitor<T> visitor)
          Visite en profondeur de l'arbre, il est possible d'arreter la visite soit en entrant dans le noeud soit en sortant du noeud, si respectivement visitEnter ou visitLeave retourne false.
 int getAttCount()
          Retourn le nombre d'attachment pour ce noeud (avec les sous noeud)
 TreeNodeResult<T> getChild(T child)
          Return TreeNodeResult where object in TreeNodeResult equals child in parameter
 List<TreeNodeResult<T>> getChildren()
          Get direct children of this node
 T getObject()
          Retourne l'objet associe avec ce noeud (id, wikitty ou BusinessEntity)
 Iterator<TreeNodeResult<T>> iterator()
          Iterate on all children or sub-children, in depth first
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attCount

protected int attCount
Constructor Detail

TreeNodeResult

public TreeNodeResult(T object,
                      int attCount)
Parameters:
object - L'id, le wikitty ou le BusinessEntity suivant le type de T
attCount - le nombre d'attachment pour ce noeud (avec les sous noeud)
Method Detail

acceptVisitor

public boolean acceptVisitor(TreeNodeResult.Visitor<T> visitor)
Visite en profondeur de l'arbre, il est possible d'arreter la visite soit en entrant dans le noeud soit en sortant du noeud, si respectivement visitEnter ou visitLeave retourne false.

Parameters:
visitor -

getChildren

public List<TreeNodeResult<T>> getChildren()
Get direct children of this node

Returns:

iterator

public Iterator<TreeNodeResult<T>> iterator()
Iterate on all children or sub-children, in depth first

Specified by:
iterator in interface Iterable<TreeNodeResult<T>>
Returns:

getObject

public T getObject()
Retourne l'objet associe avec ce noeud (id, wikitty ou BusinessEntity)

Returns:
l'objet associe avec ce noeud (id, wikitty ou BusinessEntity)

getChild

public TreeNodeResult<T> getChild(T child)
Return TreeNodeResult where object in TreeNodeResult equals child in parameter

Parameters:
child -
Returns:

getAttCount

public int getAttCount()
Retourn le nombre d'attachment pour ce noeud (avec les sous noeud)

Returns:


Copyright © 2009-2011 CodeLutin. All Rights Reserved.