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 directional: the two roles of a relationship are the source and target.
Relationships are typed: the type of a relationship is a PointerType
, and can
be retrieved via getType
.Constructor and Description |
---|
Pointer(PointerTarget source,
PointerType pointerType,
POS targetPOS,
long targetOffset,
int targetIndex) |
Pointer(PointerType pointerType,
PointerTarget source,
PointerTarget target) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
PointerTarget |
getSource()
Returns the source of this pointer.
|
int |
getSourceIndex() |
PointerTarget |
getTarget()
Returns the actual target of this pointer.
|
int |
getTargetIndex() |
long |
getTargetOffset()
Returns the offset of the target synset.
|
POS |
getTargetPOS() |
Synset |
getTargetSynset()
Returns 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()
Returns whether this pointer is between two words.
|
boolean |
isSemantic()
Returns whether this pointer is between two synsets.
|
boolean |
isSymmetricTo(Pointer that)
Returns whether that is symmetric to this pointer.
|
void |
setTarget(PointerTarget target)
Sets the actual target of this pointer.
|
java.lang.String |
toString() |
public Pointer(PointerTarget source, PointerType pointerType, POS targetPOS, long targetOffset, int targetIndex)
public Pointer(PointerType pointerType, PointerTarget source, PointerTarget target)
public java.lang.String toString()
toString
in class java.lang.Object
public int getSourceIndex()
public PointerType getType()
public boolean isLexical() throws JWNLException
JWNLException
- JWNLExceptionpublic boolean isSemantic() throws JWNLException
JWNLException
- JWNLExceptionpublic boolean isSymmetricTo(Pointer that) throws JWNLException
that
- pointerJWNLException
- JWNLExceptionpublic PointerTarget getSource()
public PointerTarget getTarget() throws JWNLException
JWNLException
- JWNLExceptionpublic void setTarget(PointerTarget target)
target
- actual target of this pointerpublic Synset getTargetSynset() throws JWNLException
JWNLException
- JWNLExceptionpublic long getTargetOffset() throws JWNLException
JWNLException
- JWNLExceptionpublic int getTargetIndex() throws JWNLException
JWNLException
public POS getTargetPOS() throws JWNLException
JWNLException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object