Package net.didion.jwnl.data
Class Pointer
java.lang.Object
net.didion.jwnl.data.Pointer
- All Implemented Interfaces:
Serializable
A directional : the two roles of a relationship are the source and target .
Relationships are typed : the type of a relationship is a
Pointer
encodes a lexical or semantic relationship between WordNet entities. A lexical
relationship holds between Words; a semantic relationship holds between Synsets. Relationships
are PointerType
, and can
be retrieved via getType
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
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
FieldsModifier and TypeFieldDescriptionprivate String
private int
The index of this Pointer within the array of Pointer's in the source Synset.private PointerType
private PointerTarget
The source of this poiner.private PointerTarget
Cache for the target after it has been resolved.private Pointer.TargetIndex
An index that can be used to retrieve the target.(package private) static final long
-
Constructor Summary
ConstructorsConstructorDescriptionPointer
(PointerTarget source, int index, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the source of this pointer.int
Get the actual target of this pointer.int
long
Get the offset of the target within the target synset.Get the synset that is a) the target of this pointer, or b) the * synset that contains the target of this pointer.getType()
int
hashCode()
boolean
True if this pointer's source is a Wordprivate void
toString()
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
_index
private int _indexThe index of this Pointer within the array of Pointer's in the source Synset. Used byequal
. -
_pointerType
-
_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
An index that can be used to retrieve the target. -
_target
Cache for the target after it has been resolved. -
_cachedToString
-
-
Constructor Details
-
Pointer
public Pointer(PointerTarget source, int index, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getSourceIndex
public int getSourceIndex() -
getType
-
isLexical
public boolean isLexical()True if this pointer's source is a Word -
getSource
Get the source of this pointer. -
getTarget
Get the actual target of this pointer.- Throws:
JWNLException
-
getTargetSynset
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
-
readObject
- Throws:
IOException
ClassNotFoundException
-