public class Pointer
extends java.lang.Object
implements java.io.Serializable
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.| Modifier and Type | Class and 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.
|
| Modifier and Type | Field and 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 and Description |
|---|
Pointer(PointerTarget source,
int index,
PointerType pointerType,
POS targetPOS,
long targetOffset,
int targetIndex) |
| Modifier and Type | Method and 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 Word
|
private void |
readObject(java.io.ObjectInputStream in) |
java.lang.String |
toString() |
static final long serialVersionUID
private int _index
equal.private PointerType _pointerType
private PointerTarget _source
source and synset are the same,
otherwise source is the specific Word object that
this pointer applies to.private Pointer.TargetIndex _targetIndex
private transient PointerTarget _target
private transient java.lang.String _cachedToString
public Pointer(PointerTarget source, int index, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex)
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getSourceIndex()
public PointerType getType()
public boolean isLexical()
public PointerTarget getSource()
public PointerTarget getTarget() throws JWNLException
JWNLExceptionpublic Synset getTargetSynset() throws JWNLException
JWNLExceptionpublic long getTargetOffset()
public int getTargetIndex()
public POS getTargetPOS()
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundException