edu.mit.jwi.item
Class ExceptionEntryID

java.lang.Object
  extended by edu.mit.jwi.item.ExceptionEntryID
All Implemented Interfaces:
IExceptionEntryID, IHasPOS, IItemID<IExceptionEntry>, java.io.Serializable

public class ExceptionEntryID
extends java.lang.Object
implements IExceptionEntryID

Default implementation of IExceptionEntryID.

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

Constructor Summary
ExceptionEntryID(java.lang.String surfaceForm, POS pos)
          Creates a new exception entry id with the specified information.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 POS getPOS()
          Returns the associated part of speech for this object.
 java.lang.String getSurfaceForm()
          Returns the surface form (i.e., not the root form) of the word for which a morphological exception entry is desired.
 int hashCode()
           
static ExceptionEntryID parseExceptionEntryID(java.lang.String value)
          Convenience method for transforming the result of the toString() method back into an IExceptionEntryID.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExceptionEntryID

public ExceptionEntryID(java.lang.String surfaceForm,
                        POS pos)
Creates a new exception entry id with the specified information.

Parameters:
surfaceForm - the surface form for the entry
pos - the part of speech for the entry
Throws:
java.lang.NullPointerException - if either argument is null
java.lang.IllegalArgumentException - if the surface form is empty or all whitespace
Since:
JWI 1.0
Method Detail

getSurfaceForm

public java.lang.String getSurfaceForm()
Description copied from interface: IExceptionEntryID
Returns the surface form (i.e., not the root form) of the word for which a morphological exception entry is desired. Because all surface forms in the exception files are lower case, the string returned by this call is also lower case.

Specified by:
getSurfaceForm in interface IExceptionEntryID
Returns:
the lowercase surface form of the exception entry indicated by this id object

getPOS

public POS getPOS()
Description copied from interface: IHasPOS
Returns the associated part of speech for this object. If this object is not associated with any particular part of speech, this method may return null.

Specified by:
getPOS in interface IHasPOS
Returns:
The associated part of speech, or null if none.

toString

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

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

parseExceptionEntryID

public static ExceptionEntryID parseExceptionEntryID(java.lang.String value)
Convenience method for transforming the result of the toString() method back into an IExceptionEntryID.

Parameters:
value - the string to parse
Returns:
the derived exception entry id
Throws:
java.lang.NullPointerException - if the specified string is null
java.lang.IllegalArgumentException - if the specified string does not conform to an exception entry id
Since:
JWI 2.2.0


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