it.unitn.disi.smatch.data
Class Node

java.lang.Object
  extended by it.unitn.disi.smatch.data.Node
All Implemented Interfaces:
INode, INodeData

public class Node
extends java.lang.Object
implements INodeData, INode

This class represent a node in the hierarchy. It contains logical (cNode and cLab formulas); linguistic (WN senses,tokens) and structural information (parent and children of Node).


Constructor Summary
Node()
           
Node(java.lang.String nodeName, java.lang.String nodeId)
           
 
Method Summary
 void addAtomicConceptOfLabel(IAtomicConceptOfLabel sense)
          adds atomic concepts of label to the node
 void addChild(INode child)
          Adds child to the given node.
 boolean equals(java.lang.Object o)
           
 IAtomicConceptOfLabel getAColById(java.lang.String tokenUID)
          Get node acol by Id.
 java.util.Vector<IAtomicConceptOfLabel> getACoLs()
          returns atomic concepts of labels associated with the givem node
 java.util.Vector<java.lang.String> getAlternativeLabels()
           
 java.util.Vector<INode> getAncestors()
          The returned list is orderd from the father node to the root.
 java.util.Vector<INode> getChildren()
          Returns children of the node.
 java.lang.String getcLabFormula()
           
 java.lang.String getCNodeFormula()
           
 int getDepth()
          returns depth of the node in the context
 int getDescendantCount()
          Returns count of descendant nodes, including itself.
 java.util.Vector<INode> getDescendants()
          Returns all descendants of the node.
 int getIndex()
          Gets index in a Vector.
static INode getInstance()
           
static INode getInstance(java.lang.String nodeName, java.lang.String nodeId)
           
 IAtomicConceptOfLabel getNMTAColById(java.lang.String tokenUID)
          Get node matching task acol by Id.
 INodeData getNodeData()
          Returns interface to node metadata.
 java.lang.String getNodeId()
          Retunrs node id.
 java.util.Vector<IAtomicConceptOfLabel> getNodeMatchingTaskACols()
          Fill and get the Vector of all logical formula representations of all concepts
 java.lang.String getNodeName()
          Returns node label.
 java.lang.String getNodeUniqueName()
           
 INode getParent()
          Returns interface to the parent node.
 java.lang.String getParentRelationType()
           
 java.lang.String getPathToRootString()
          returns path to root string for the given node
 boolean getSource()
          Indicates whether this node belongs to the source context.
 java.util.Vector<java.lang.String> getSynonyms()
           
 double getWeight()
           
 int hashCode()
           
 boolean isRoot()
          Retunrs true if the node is a root in the context and false otherwise.
 void removeChild(INode child)
          Removes child of the node.
 void resetLogicalFormula()
          clears cLab formula
 void resetSetOfSenses()
          clear sets of senses
 void setcLabFormula(java.lang.String cLabFormula)
           
 void setcLabFormulaToConjunciveForm(java.lang.String formula)
          Set cLab formula to CNF and store in the concept
 void setcNodeFormula(java.lang.String cNodeFormula)
           
 void setIndex(int index)
          Sets index in a Vector.
 void setNodeId(java.lang.String nodeId)
           
 void setNodeName(java.lang.String nodeName)
           
 void setNodeUniqueName()
           
 void setNodeUniqueName(java.lang.String uniqueName)
           
 void setParent(INode parent)
           
 void setSource(boolean source)
           
 void sort()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node()

Node

public Node(java.lang.String nodeName,
            java.lang.String nodeId)
Method Detail

setNodeName

public void setNodeName(java.lang.String nodeName)
Specified by:
setNodeName in interface INodeData

getSynonyms

public java.util.Vector<java.lang.String> getSynonyms()
Specified by:
getSynonyms in interface INodeData

getAlternativeLabels

public java.util.Vector<java.lang.String> getAlternativeLabels()
Specified by:
getAlternativeLabels in interface INodeData

getWeight

public double getWeight()
Specified by:
getWeight in interface INodeData

getcLabFormula

public java.lang.String getcLabFormula()
Specified by:
getcLabFormula in interface INodeData

setcLabFormula

public void setcLabFormula(java.lang.String cLabFormula)
Specified by:
setcLabFormula in interface INodeData

setcNodeFormula

public void setcNodeFormula(java.lang.String cNodeFormula)
Specified by:
setcNodeFormula in interface INodeData

getInstance

public static INode getInstance()

getNodeData

public INodeData getNodeData()
Description copied from interface: INode
Returns interface to node metadata.

Specified by:
getNodeData in interface INode
Returns:
interface to node metadata

setcLabFormulaToConjunciveForm

public void setcLabFormulaToConjunciveForm(java.lang.String formula)
Set cLab formula to CNF and store in the concept

Specified by:
setcLabFormulaToConjunciveForm in interface INodeData

resetLogicalFormula

public void resetLogicalFormula()
Description copied from interface: INodeData
clears cLab formula

Specified by:
resetLogicalFormula in interface INodeData

resetSetOfSenses

public void resetSetOfSenses()
Description copied from interface: INodeData
clear sets of senses

Specified by:
resetSetOfSenses in interface INodeData

addAtomicConceptOfLabel

public void addAtomicConceptOfLabel(IAtomicConceptOfLabel sense)
Description copied from interface: INodeData
adds atomic concepts of label to the node

Specified by:
addAtomicConceptOfLabel in interface INodeData

addChild

public void addChild(INode child)
Description copied from interface: INode
Adds child to the given node.

Specified by:
addChild in interface INode
Parameters:
child - node to add

getAncestors

public java.util.Vector<INode> getAncestors()
The returned list is orderd from the father node to the root.

Specified by:
getAncestors in interface INode
Returns:
ancestor list

getDescendants

public java.util.Vector<INode> getDescendants()
Description copied from interface: INode
Returns all descendants of the node. The returned list is order as in depth first traversal.

Specified by:
getDescendants in interface INode
Returns:
descendants

getDescendantCount

public int getDescendantCount()
Description copied from interface: INode
Returns count of descendant nodes, including itself.

Specified by:
getDescendantCount in interface INode
Returns:
count of descendant nodes, including itself

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isRoot

public boolean isRoot()
Description copied from interface: INode
Retunrs true if the node is a root in the context and false otherwise.

Specified by:
isRoot in interface INode
Returns:
true if node is a root

getDepth

public int getDepth()
Description copied from interface: INodeData
returns depth of the node in the context

Specified by:
getDepth in interface INodeData
Returns:

getIndex

public int getIndex()
Description copied from interface: INodeData
Gets index in a Vector. This is to avoid hashtables.

Specified by:
getIndex in interface INodeData
Returns:

setIndex

public void setIndex(int index)
Description copied from interface: INodeData
Sets index in a Vector. This is to avoid hashtables.

Specified by:
setIndex in interface INodeData

getSource

public boolean getSource()
Description copied from interface: INodeData
Indicates whether this node belongs to the source context. This is needed for new algorithms which sometimes swap order.

Specified by:
getSource in interface INodeData
Returns:

setSource

public void setSource(boolean source)
Specified by:
setSource in interface INodeData

sort

public void sort()
Specified by:
sort in interface INodeData

getPathToRootString

public java.lang.String getPathToRootString()
Description copied from interface: INodeData
returns path to root string for the given node

Specified by:
getPathToRootString in interface INodeData
Returns:

getParent

public INode getParent()
Description copied from interface: INode
Returns interface to the parent node.

Specified by:
getParent in interface INode
Returns:
interface to the parent node

getParentRelationType

public java.lang.String getParentRelationType()
Specified by:
getParentRelationType in interface INodeData

getNodeId

public java.lang.String getNodeId()
Description copied from interface: INode
Retunrs node id.

Specified by:
getNodeId in interface INode
Returns:
node id

getNodeName

public java.lang.String getNodeName()
Description copied from interface: INode
Returns node label.

Specified by:
getNodeName in interface INode
Returns:
node label

getNodeUniqueName

public java.lang.String getNodeUniqueName()
Specified by:
getNodeUniqueName in interface INodeData

getChildren

public java.util.Vector<INode> getChildren()
Description copied from interface: INode
Returns children of the node.

Specified by:
getChildren in interface INode
Returns:
node children

setParent

public void setParent(INode parent)
Specified by:
setParent in interface INodeData

getCNodeFormula

public java.lang.String getCNodeFormula()
Specified by:
getCNodeFormula in interface INodeData

getACoLs

public java.util.Vector<IAtomicConceptOfLabel> getACoLs()
Description copied from interface: INodeData
returns atomic concepts of labels associated with the givem node

Specified by:
getACoLs in interface INodeData
Returns:

setNodeUniqueName

public void setNodeUniqueName(java.lang.String uniqueName)
Specified by:
setNodeUniqueName in interface INodeData

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getInstance

public static INode getInstance(java.lang.String nodeName,
                                java.lang.String nodeId)

setNodeUniqueName

public void setNodeUniqueName()
Specified by:
setNodeUniqueName in interface INodeData

setNodeId

public void setNodeId(java.lang.String nodeId)
Specified by:
setNodeId in interface INodeData

removeChild

public void removeChild(INode child)
Description copied from interface: INode
Removes child of the node.

Specified by:
removeChild in interface INode
Parameters:
child - child node to remove

getNMTAColById

public IAtomicConceptOfLabel getNMTAColById(java.lang.String tokenUID)
Description copied from interface: INodeData
Get node matching task acol by Id.

Specified by:
getNMTAColById in interface INodeData
Parameters:
tokenUID - token id
Returns:
acol

getAColById

public IAtomicConceptOfLabel getAColById(java.lang.String tokenUID)
Description copied from interface: INodeData
Get node acol by Id.

Specified by:
getAColById in interface INodeData
Parameters:
tokenUID - token id
Returns:
acol

getNodeMatchingTaskACols

public java.util.Vector<IAtomicConceptOfLabel> getNodeMatchingTaskACols()
Fill and get the Vector of all logical formula representations of all concepts

Specified by:
getNodeMatchingTaskACols in interface INodeData
Returns:


© 2010 Knowdive @ DISI