Class Pointer

  • All Implemented Interfaces:
    java.io.Serializable

    public class Pointer
    extends java.lang.Object
    implements java.io.Serializable
    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 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.
    See Also:
    Serialized Form
    • Field Detail

      • _index

        private int _index
        The index of this Pointer within the array of Pointer's in the source Synset. Used by equal.
      • _source

        private PointerTarget _source
        The source of this poiner. If the pointer applies to all words in the parent synset, then source and synset are the same, otherwise source is the specific Word 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSourceIndex

        public int getSourceIndex()
      • isLexical

        public boolean isLexical()
        True if this pointer's source is a Word
      • getSource

        public PointerTarget getSource()
        Get the source of this pointer.
      • 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