Package net.didion.jwnl.data.list
Class PointerTargetNode
- java.lang.Object
-
- net.didion.jwnl.data.list.PointerTargetNode
-
- All Implemented Interfaces:
java.lang.Cloneable,Node,DeepCloneable
- Direct Known Subclasses:
PointerTargetTreeNode
public class PointerTargetNode extends java.lang.Object implements Node
A node in aPointerTargetNodeList.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_cachedToStringprivate PointerTarget_targetThe PointerTargetprivate PointerType_typeThe relation type that produced this node.
-
Constructor Summary
Constructors Constructor Description PointerTargetNode(PointerTarget target)PointerTargetNode(PointerTarget target, PointerType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Create a shallow clone of the objectjava.lang.ObjectdeepClone()Create a deep clone of the objectbooleanequals(java.lang.Object object)Two PointerTargetNodes are equal if they have the same type and PointerTargetPointerTargetgetPointerTarget()SynsetgetSynset()If the target is a synset, return it, otherwise it's a word so return the word's parent synset.PointerTypegetType()WordgetWord()If the target is a word, return it, otherwise return null.inthashCode()booleanisLexical()Returns true if the target is a Word, else false.voidsetType(PointerType type)java.lang.StringtoString()
-
-
-
Field Detail
-
_target
private PointerTarget _target
The PointerTarget
-
_type
private PointerType _type
The relation type that produced this node. e.g. if you make a call to getDirectHypernyms(), each node in the resultant list will have a type of PointerType.HYPERNYM.
-
_cachedToString
private transient java.lang.String _cachedToString
-
-
Constructor Detail
-
PointerTargetNode
public PointerTargetNode(PointerTarget target)
-
PointerTargetNode
public PointerTargetNode(PointerTarget target, PointerType type)
-
-
Method Detail
-
setType
public void setType(PointerType type)
-
getType
public PointerType getType()
-
getPointerTarget
public PointerTarget getPointerTarget()
-
isLexical
public boolean isLexical()
Returns true if the target is a Word, else false.
-
getSynset
public Synset getSynset()
If the target is a synset, return it, otherwise it's a word so return the word's parent synset.
-
getWord
public Word getWord()
If the target is a word, return it, otherwise return null.
-
equals
public boolean equals(java.lang.Object object)
Two PointerTargetNodes are equal if they have the same type and PointerTarget- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
public java.lang.Object clone()
Description copied from interface:DeepCloneableCreate a shallow clone of the object- Specified by:
clonein interfaceDeepCloneable- Overrides:
clonein classjava.lang.Object
-
deepClone
public java.lang.Object deepClone() throws java.lang.UnsupportedOperationExceptionDescription copied from interface:DeepCloneableCreate a deep clone of the object- Specified by:
deepClonein interfaceDeepCloneable- Throws:
java.lang.UnsupportedOperationException
-
-