Package net.didion.jwnl.data
Class Pointer
- java.lang.Object
-
- net.didion.jwnl.data.Pointer
-
- All Implemented Interfaces:
java.io.Serializable
public class Pointer extends java.lang.Object implements java.io.Serializable
APointer
encodes a lexical or semantic relationship between WordNet entities. A lexical relationship holds between Words; a semantic relationship holds between Synsets. Relationships aredirectional : the two roles of a relationship are thesource andtarget . Relationships aretyped : the type of a relationship is aPointerType
, and can be retrieved viagetType
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Pointer.TargetIndex
This class is used to avoid paging in the target before it is required, and to prevent keeping a large portion of the database resident once the target has been queried.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
_cachedToString
private int
_index
The index of this Pointer within the array of Pointer's in the source Synset.private PointerType
_pointerType
private PointerTarget
_source
The source of this poiner.private PointerTarget
_target
Cache for the target after it has been resolved.private Pointer.TargetIndex
_targetIndex
An index that can be used to retrieve the target.(package private) static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description Pointer(PointerTarget source, int index, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
PointerTarget
getSource()
Get the source of this pointer.int
getSourceIndex()
PointerTarget
getTarget()
Get the actual target of this pointer.int
getTargetIndex()
long
getTargetOffset()
Get the offset of the target within the target synset.POS
getTargetPOS()
Synset
getTargetSynset()
Get the synset that is a) the target of this pointer, or b) the * synset that contains the target of this pointer.PointerType
getType()
int
hashCode()
boolean
isLexical()
True if this pointer's source is a Wordprivate void
readObject(java.io.ObjectInputStream in)
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
_index
private int _index
The index of this Pointer within the array of Pointer's in the source Synset. Used byequal
.
-
_pointerType
private PointerType _pointerType
-
_source
private PointerTarget _source
The source of this poiner. If the pointer applies to all words in the parent synset, thensource
andsynset
are the same, otherwisesource
is the specificWord
object that this pointer applies to.
-
_targetIndex
private Pointer.TargetIndex _targetIndex
An index that can be used to retrieve the target.
-
_target
private transient PointerTarget _target
Cache for the target after it has been resolved.
-
_cachedToString
private transient java.lang.String _cachedToString
-
-
Constructor Detail
-
Pointer
public Pointer(PointerTarget source, int index, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSourceIndex
public int getSourceIndex()
-
getType
public PointerType getType()
-
isLexical
public boolean isLexical()
True if this pointer's source is a Word
-
getSource
public PointerTarget getSource()
Get the source of this pointer.
-
getTarget
public PointerTarget getTarget() throws JWNLException
Get the actual target of this pointer.- Throws:
JWNLException
-
getTargetSynset
public Synset getTargetSynset() throws JWNLException
Get the synset that is a) the target of this pointer, or b) the * synset that contains the target of this pointer.- Throws:
JWNLException
-
getTargetOffset
public long getTargetOffset()
Get the offset of the target within the target synset. If the offset is * 0, then this pointer applies to all words in the target.
-
getTargetIndex
public int getTargetIndex()
-
getTargetPOS
public POS getTargetPOS()
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-