edu.mit.jwi.item
Class Pointer

java.lang.Object
  extended by edu.mit.jwi.item.Pointer
All Implemented Interfaces:
IPointer, java.io.Serializable

public class Pointer
extends java.lang.Object
implements IPointer

Concrete implementation of the IPointer interface. This class includes, as public fields, all pointers, lexical and semantic, defined in the standard WordNet distribution.

This class in not implemented as an Enum so that clients may instantiate their own pointers using this implementation.

Since:
JWI 2.1.0
Version:
2.4.0
Author:
Mark A. Finlayson
See Also:
Serialized Form

Field Summary
static Pointer ALSO_SEE
           
static Pointer ANTONYM
           
static Pointer ATTRIBUTE
           
static Pointer CAUSE
           
static Pointer DERIVATIONALLY_RELATED
           
static Pointer DERIVED_FROM_ADJ
           
static Pointer DOMAIN
           
static Pointer ENTAILMENT
           
static Pointer HOLONYM_MEMBER
           
static Pointer HOLONYM_PART
           
static Pointer HOLONYM_SUBSTANCE
           
static Pointer HYPERNYM
           
static Pointer HYPERNYM_INSTANCE
           
static Pointer HYPONYM
           
static Pointer HYPONYM_INSTANCE
           
static Pointer MEMBER
           
static Pointer MERONYM_MEMBER
           
static Pointer MERONYM_PART
           
static Pointer MERONYM_SUBSTANCE
           
static Pointer PARTICIPLE
           
static Pointer PERTAINYM
           
static Pointer REGION
           
static Pointer REGION_MEMBER
           
static Pointer SIMILAR_TO
           
static Pointer TOPIC
           
static Pointer TOPIC_MEMBER
           
static Pointer USAGE
           
static Pointer USAGE_MEMBER
           
static Pointer VERB_GROUP
           
 
Constructor Summary
Pointer(java.lang.String symbol, java.lang.String name)
          Constructs a new pointer object with the specified symbol and name.
 
Method Summary
protected static java.lang.String checkString(java.lang.String str)
          Throws an exception if the specified string is null, empty, or all whitespace.
 java.lang.String getName()
          Returns a user-friendly name of this pointer type for identification purposes.
static Pointer getPointerType(java.lang.String symbol, POS pos)
          Returns the pointer type (static final instance) that matches the specified pointer symbol.
 java.lang.String getSymbol()
          The symbol in the Wordnet data files that is used to indicate this pointer type.
protected  java.lang.Object readResolve()
          This utility method implements the appropriate deserialization for this object.
 java.lang.String toString()
           
static java.util.Collection<Pointer> values()
          Emulates the Enum#values() function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALSO_SEE

public static final Pointer ALSO_SEE

ANTONYM

public static final Pointer ANTONYM

ATTRIBUTE

public static final Pointer ATTRIBUTE

CAUSE

public static final Pointer CAUSE

DERIVATIONALLY_RELATED

public static final Pointer DERIVATIONALLY_RELATED

DERIVED_FROM_ADJ

public static final Pointer DERIVED_FROM_ADJ

DOMAIN

public static final Pointer DOMAIN

ENTAILMENT

public static final Pointer ENTAILMENT

HYPERNYM

public static final Pointer HYPERNYM

HYPERNYM_INSTANCE

public static final Pointer HYPERNYM_INSTANCE

HYPONYM

public static final Pointer HYPONYM

HYPONYM_INSTANCE

public static final Pointer HYPONYM_INSTANCE

HOLONYM_MEMBER

public static final Pointer HOLONYM_MEMBER

HOLONYM_SUBSTANCE

public static final Pointer HOLONYM_SUBSTANCE

HOLONYM_PART

public static final Pointer HOLONYM_PART

MEMBER

public static final Pointer MEMBER

MERONYM_MEMBER

public static final Pointer MERONYM_MEMBER

MERONYM_SUBSTANCE

public static final Pointer MERONYM_SUBSTANCE

MERONYM_PART

public static final Pointer MERONYM_PART

PARTICIPLE

public static final Pointer PARTICIPLE

PERTAINYM

public static final Pointer PERTAINYM

REGION

public static final Pointer REGION

REGION_MEMBER

public static final Pointer REGION_MEMBER

SIMILAR_TO

public static final Pointer SIMILAR_TO

TOPIC

public static final Pointer TOPIC

TOPIC_MEMBER

public static final Pointer TOPIC_MEMBER

USAGE

public static final Pointer USAGE

USAGE_MEMBER

public static final Pointer USAGE_MEMBER

VERB_GROUP

public static final Pointer VERB_GROUP
Constructor Detail

Pointer

public Pointer(java.lang.String symbol,
               java.lang.String name)
Constructs a new pointer object with the specified symbol and name.

Parameters:
symbol - the pointer symbol; may not be null, empty, or all whitespace
name - the pointer name; may not be null, empty, or all whitespace
Since:
JWI 2.1.0
Method Detail

getSymbol

public java.lang.String getSymbol()
Description copied from interface: IPointer
The symbol in the Wordnet data files that is used to indicate this pointer type. Will not be null, empty, or all whitespace.

Specified by:
getSymbol in interface IPointer
Returns:
the symbol for this pointer

getName

public java.lang.String getName()
Description copied from interface: IPointer
Returns a user-friendly name of this pointer type for identification purposes. Will not be null, empty, or all whitespace.

Specified by:
getName in interface IPointer
Returns:
the user-friendly name of this pointer

toString

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

readResolve

protected java.lang.Object readResolve()
This utility method implements the appropriate deserialization for this object.

Returns:
the appropriate deserialized object.
Since:
JWI 2.4.0

checkString

protected static java.lang.String checkString(java.lang.String str)
Throws an exception if the specified string is null, empty, or all whitespace. Returns a trimmed form of the string.

Parameters:
str - the string to be checked
Returns:
a trimmed form of the string
Throws:
java.lang.NullPointerException - if the specified string is null
java.lang.IllegalArgumentException - if the specified string is empty or all whitespace
Since:
JWI 2.2.0

values

public static java.util.Collection<Pointer> values()
Emulates the Enum#values() function. Returns an unmodifiable collection of all the pointers declared in this class, in the order they are declared.

Returns:
returns an unmodifiable collection of the pointers declared in this class
Since:
JWI 2.1.0

getPointerType

public static Pointer getPointerType(java.lang.String symbol,
                                     POS pos)
Returns the pointer type (static final instance) that matches the specified pointer symbol.

Parameters:
symbol - the symbol to look up
pos - the part of speech for the symbol; may be null except for ambiguous symbols
Throws:
java.lang.IllegalArgumentException - if the symbol does not correspond to a known pointer.
Since:
JWI 2.1.0


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.