net.sf.extjwnl.data.list
Class PointerTargetTreeNode

java.lang.Object
  extended by net.sf.extjwnl.data.list.PointerTargetNode
      extended by net.sf.extjwnl.data.list.PointerTargetTreeNode
All Implemented Interfaces:
Cloneable, Node, DeepCloneable

public class PointerTargetTreeNode
extends PointerTargetNode

A node in a PointerTargetTreeNodeList. Each node can have a childTreeList, which is a list of nodes that are children of this node, and a pointerTreeList, which is a tree of pointers related to this node's target. Basically, this allows for a single tree supporting multiple relationships. For example, you may have a ancestry tree, and each node, besides having links to its children, has links to the synonyms of its target.

Author:
John Didion , Aliaksandr Autayeu

Constructor Summary
PointerTargetTreeNode(PointerTarget target)
           
PointerTargetTreeNode(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type)
           
PointerTargetTreeNode(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type, PointerTargetTreeNode parent)
           
PointerTargetTreeNode(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type)
           
PointerTargetTreeNode(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type, PointerTargetTreeNode parent)
           
PointerTargetTreeNode(PointerTarget target, PointerType type)
           
PointerTargetTreeNode(PointerTarget target, PointerType type, PointerTargetTreeNode parent)
           
 
Method Summary
 PointerTargetTreeNode clone()
          Create a shallow clone of the object.
 PointerTargetTreeNode deepClone()
          Create a deep clone of the object.
 boolean equals(Object obj)
          Two PointerTargetNodes are equal if they have the same type and PointerTarget
 PointerTargetTreeNodeList getChildTreeList()
           
 PointerTargetTreeNode getParent()
           
 PointerTargetTreeNodeList getPointerTreeList()
           
 boolean hasChildTreeList()
           
 boolean hasParent()
           
 boolean hasPointerTreeList()
           
 boolean hasValidChildTreeList()
          Returns whether a childTreeList is not null and not empty.
 boolean hasValidPointerTreeList()
          Returns whether pointerTreeList is not null and not empty.
 void setChildTreeList(PointerTargetTreeNodeList list)
           
 void setParent(PointerTargetTreeNode parent)
           
 void setPointerTreeList(PointerTargetTreeNodeList list)
           
 List<PointerTargetNodeList> toList(PointerTargetNodeList list)
          Convert this node into a list of PointerTargetNodeLists's, each representing a unique branch through the tree
 String toString()
           
 
Methods inherited from class net.sf.extjwnl.data.list.PointerTargetNode
getPointerTarget, getSynset, getType, getWord, hashCode, isLexical, setType
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerTargetTreeNodeList childTreeList,
                             PointerTargetTreeNodeList pointerTreeList,
                             PointerType type,
                             PointerTargetTreeNode parent)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerType type)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerTargetTreeNodeList childTreeList,
                             PointerType type)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerType type,
                             PointerTargetTreeNode parent)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerTargetTreeNodeList childTreeList,
                             PointerType type,
                             PointerTargetTreeNode parent)

PointerTargetTreeNode

public PointerTargetTreeNode(PointerTarget target,
                             PointerTargetTreeNodeList childTreeList,
                             PointerTargetTreeNodeList pointerTreeList,
                             PointerType type)
Method Detail

equals

public boolean equals(Object obj)
Description copied from class: PointerTargetNode
Two PointerTargetNodes are equal if they have the same type and PointerTarget

Overrides:
equals in class PointerTargetNode

toString

public String toString()
Overrides:
toString in class PointerTargetNode

setChildTreeList

public void setChildTreeList(PointerTargetTreeNodeList list)

setPointerTreeList

public void setPointerTreeList(PointerTargetTreeNodeList list)

setParent

public void setParent(PointerTargetTreeNode parent)

getParent

public PointerTargetTreeNode getParent()

getChildTreeList

public PointerTargetTreeNodeList getChildTreeList()

getPointerTreeList

public PointerTargetTreeNodeList getPointerTreeList()

hasChildTreeList

public boolean hasChildTreeList()

hasValidChildTreeList

public boolean hasValidChildTreeList()
Returns whether a childTreeList is not null and not empty.

Returns:
true if childTreeList is not null and not empty

hasPointerTreeList

public boolean hasPointerTreeList()

hasValidPointerTreeList

public boolean hasValidPointerTreeList()
Returns whether pointerTreeList is not null and not empty.

Returns:
true if pointerTreeList is not null and not empty

hasParent

public boolean hasParent()

toList

public List<PointerTargetNodeList> toList(PointerTargetNodeList list)
Convert this node into a list of PointerTargetNodeLists's, each representing a unique branch through the tree

Parameters:
list - list
Returns:
list of pointer targets

clone

public PointerTargetTreeNode clone()
                            throws CloneNotSupportedException
Description copied from interface: DeepCloneable
Create a shallow clone of the object.

Specified by:
clone in interface DeepCloneable
Overrides:
clone in class PointerTargetNode
Throws:
CloneNotSupportedException - CloneNotSupportedException

deepClone

public PointerTargetTreeNode deepClone()
                                throws UnsupportedOperationException
Description copied from interface: DeepCloneable
Create a deep clone of the object.

Specified by:
deepClone in interface DeepCloneable
Overrides:
deepClone in class PointerTargetNode
Returns:
a deep clone of the object
Throws:
UnsupportedOperationException


Copyright © 2011. All Rights Reserved.