net.didion.jwnl.data
Class SynsetProxy

java.lang.Object
  extended by net.didion.jwnl.data.PointerTarget
      extended by net.didion.jwnl.data.Synset
          extended by net.didion.jwnl.data.SynsetProxy
All Implemented Interfaces:
java.io.Serializable, DictionaryElement

public class SynsetProxy
extends Synset

Proxy for a Synset. This class wraps a Synset that may be null at the time of creation. When this Synset is initialized (set), all method calls are forwarded to it.

See Also:
Serialized Form

Constructor Summary
SynsetProxy(POS pos)
          The only value that matters is pos, since the call to getPOS is not forwarded to _source
 
Method Summary
 boolean containsWord(java.lang.String lemma)
          Returns true if lemma is one of the words contained in this synset.
 boolean equals(java.lang.Object object)
          Two Synsets are equal if their POS's and offsets are equal
 java.lang.String getGloss()
           
 java.lang.Object getKey()
          Get a key that can be used to index this element.
 long getLexFileId()
          Gets the lexicographer file name containing this synset.
 java.lang.String getLexFileName()
          Gets the lex file name.
 long getOffset()
           
 Pointer[] getPointers()
          Return a list of Target's pointers
 Pointer[] getPointers(PointerType type)
          Get all pointers of type type.
 PointerTarget[] getTargets()
          Get all the pointer targets of this synset
 PointerTarget[] getTargets(PointerType type)
          Get all the targets of the pointers of type type.
 java.lang.String[] getVerbFrames()
          Returns all Verb Frames that are valid for all the words in this synset
 Word getWord(int index)
           
 Word[] getWords()
           
 int hashCode()
           
 void setLexFileId(long lexFileId)
          Sets the lexicographer file name containing this synset.
 void setSource(Synset source)
           
 java.lang.String toString()
           
 
Methods inherited from class net.didion.jwnl.data.Synset
getPOS, getType, getVerbFrameFlags, getVerbFrameIndicies, getWordsSize, isAdjectiveCluster
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynsetProxy

public SynsetProxy(POS pos)
The only value that matters is pos, since the call to getPOS is not forwarded to _source

Method Detail

getPointers

public Pointer[] getPointers(PointerType type)
Description copied from class: PointerTarget
Get all pointers of type type.

Overrides:
getPointers in class PointerTarget

equals

public boolean equals(java.lang.Object object)
Description copied from class: Synset
Two Synsets are equal if their POS's and offsets are equal

Overrides:
equals in class Synset

getTargets

public PointerTarget[] getTargets()
                           throws JWNLException
Description copied from class: PointerTarget
Get all the pointer targets of this synset

Overrides:
getTargets in class PointerTarget
Throws:
JWNLException

hashCode

public int hashCode()
Overrides:
hashCode in class Synset

getTargets

public PointerTarget[] getTargets(PointerType type)
                           throws JWNLException
Description copied from class: PointerTarget
Get all the targets of the pointers of type type.

Overrides:
getTargets in class PointerTarget
Throws:
JWNLException

toString

public java.lang.String toString()
Overrides:
toString in class Synset

getPointers

public Pointer[] getPointers()
Description copied from class: PointerTarget
Return a list of Target's pointers

Overrides:
getPointers in class Synset

getGloss

public java.lang.String getGloss()
Overrides:
getGloss in class Synset

getWords

public Word[] getWords()
Overrides:
getWords in class Synset

getWord

public Word getWord(int index)
Overrides:
getWord in class Synset

getOffset

public long getOffset()
Overrides:
getOffset in class Synset

getKey

public java.lang.Object getKey()
Description copied from interface: DictionaryElement
Get a key that can be used to index this element.

Specified by:
getKey in interface DictionaryElement
Overrides:
getKey in class Synset

getVerbFrames

public java.lang.String[] getVerbFrames()
Description copied from class: Synset
Returns all Verb Frames that are valid for all the words in this synset

Overrides:
getVerbFrames in class Synset

containsWord

public boolean containsWord(java.lang.String lemma)
Description copied from class: Synset
Returns true if lemma is one of the words contained in this synset.

Overrides:
containsWord in class Synset

getLexFileName

public java.lang.String getLexFileName()
Description copied from class: Synset
Gets the lex file name.

Overrides:
getLexFileName in class Synset
Returns:

getLexFileId

public long getLexFileId()
Description copied from class: Synset
Gets the lexicographer file name containing this synset.

Overrides:
getLexFileId in class Synset
Returns:
two digit decimal integer

setLexFileId

public void setLexFileId(long lexFileId)
Description copied from class: Synset
Sets the lexicographer file name containing this synset.

Overrides:
setLexFileId in class Synset
Parameters:
lexFileId - - the lexicographer file name id

setSource

public void setSource(Synset source)