ca.site.elkb
Class Reference

java.lang.Object
  extended by ca.site.elkb.Reference
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SemRel

public class Reference
extends java.lang.Object
implements java.io.Serializable

Represents a symbolic pointer to a location where a specific word or phrase can be found in Roget's Thesaurus. A reference is identified by a keyword, head number and part of speech sequence.

An example of a Reference is: obstetrics 167 n. This instance of a Reference is represented as:

A Reference is always liked to an index entry, for example: stork.

Version:
1.4 2013
Author:
Mario Jarmasz and Alistsair Kennedy
See Also:
Serialized Form

Constructor Summary
Reference()
          Default constructor.
Reference(java.lang.String ref)
          Constructor that creates a Reference object by parsing a string.
Reference(java.lang.String name, int head, java.lang.String p)
          Constructor which sets the reference name, Head number and part-of-speech.
Reference(java.lang.String name, int head, java.lang.String p, java.lang.String entry)
          Constructor which sets the referebnce name, Head number, part-of-speech, and Index entry.
 
Method Summary
 int getHeadNum()
          Returns the Head number of this Reference.
 java.lang.String getIndexEntry()
          Returns the Index entry of this Reference.
 java.lang.String getPos()
          Returns the part-of-speech of this Reference.
 java.lang.String getRefName()
          Returns the name of this Reference.
 void print()
          Prints this Reference to the standard output.
 void setHeadNum(int head)
          Sets the Head number of this Reference.
 void setIndexEntry(java.lang.String entry)
          Sets the Index entry of this Reference.
 void setPos(java.lang.String p)
          Sets the part-of-speech of this Reference.
 void setRefName(java.lang.String name)
          Sets the name of this Reference.
 java.lang.String toString()
          Converts to a string representation the Reference object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reference

public Reference()
Default constructor.


Reference

public Reference(java.lang.String name,
                 int head,
                 java.lang.String p)
Constructor which sets the reference name, Head number and part-of-speech.

Parameters:
name -
head -
p -

Reference

public Reference(java.lang.String name,
                 int head,
                 java.lang.String p,
                 java.lang.String entry)
Constructor which sets the referebnce name, Head number, part-of-speech, and Index entry.

Parameters:
name -
head -
p -
entry -

Reference

public Reference(java.lang.String ref)
Constructor that creates a Reference object by parsing a string. An example of a reference that can be parsed is: light 417 N.. The Index entry is not parsed with the reference.

Parameters:
ref -
Method Detail

toString

public java.lang.String toString()
Converts to a string representation the Reference object. The returned string will be similar to:
word list 87 n. [thesaurus]
RefName HeadNum POS [IndexEntry]
The Index entry is printed only if it has been assigned.

Overrides:
toString in class java.lang.Object

print

public void print()
Prints this Reference to the standard output. The Refernce is printed similar to:
word list 87 n.
RefName HeadNum POS


getRefName

public java.lang.String getRefName()
Returns the name of this Reference.

Returns:
reference name

setRefName

public void setRefName(java.lang.String name)
Sets the name of this Reference.

Parameters:
name -

getPos

public java.lang.String getPos()
Returns the part-of-speech of this Reference.

Returns:
POS

setPos

public void setPos(java.lang.String p)
Sets the part-of-speech of this Reference.

Parameters:
p -

getHeadNum

public int getHeadNum()
Returns the Head number of this Reference.

Returns:
head number

setHeadNum

public void setHeadNum(int head)
Sets the Head number of this Reference.

Parameters:
head -

getIndexEntry

public java.lang.String getIndexEntry()
Returns the Index entry of this Reference.

Returns:
index entry

setIndexEntry

public void setIndexEntry(java.lang.String entry)
Sets the Index entry of this Reference.

Parameters:
entry -