edu.brandeis.cs.steele.wn
Class Pointer

java.lang.Object
  extended by edu.brandeis.cs.steele.wn.Pointer

public class Pointer
extends java.lang.Object

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.

Author:
Oliver Steele, steele@cs.brandeis.edu

Nested Class Summary
protected  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
protected  FileBackedDictionary dictionary
           
protected  int index
          The index of this Pointer within the array of Pointer's in the source Synset.
protected  PointerType pointerType
           
protected  PointerTarget source
           
protected  Synset synset
           
protected  Pointer.TargetIndex targetIndex
          An index that can be used to retrieve the target.
 
Constructor Summary
Pointer(FileBackedDictionary dictionary, Synset synset, int index)
           
 
Method Summary
 boolean equals(java.lang.Object object)
           
 PointerTarget getSource()
           
 PointerTarget getTarget()
           
 PointerType getType()
           
 int hashCode()
           
(package private)  Pointer initializeFrom(TokenizerParser tokenizer)
           
 boolean isLexical()
           
(package private) static Pointer parsePointer(FileBackedDictionary dictionary, Synset source, int index, TokenizerParser tokenizer)
           
protected  PointerTarget resolveTarget(Synset synset, int index)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dictionary

protected FileBackedDictionary dictionary

synset

protected Synset synset

index

protected int index
The index of this Pointer within the array of Pointer's in the source Synset. Used by equal.


pointerType

protected PointerType pointerType

source

protected PointerTarget source

targetIndex

protected Pointer.TargetIndex targetIndex
An index that can be used to retrieve the target. The first time this is used, it acts as an external key; subsequent uses, in conjunction with FileBackedDictionary's caching mechanism, can be thought of as a weak reference.

Constructor Detail

Pointer

Pointer(FileBackedDictionary dictionary,
        Synset synset,
        int index)
Method Detail

initializeFrom

Pointer initializeFrom(TokenizerParser tokenizer)

parsePointer

static Pointer parsePointer(FileBackedDictionary dictionary,
                            Synset source,
                            int index,
                            TokenizerParser tokenizer)

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

getType

public PointerType getType()

isLexical

public boolean isLexical()

resolveTarget

protected PointerTarget resolveTarget(Synset synset,
                                      int index)

getSource

public PointerTarget getSource()

getTarget

public PointerTarget getTarget()