edu.northwestern.at.wordhoard.swing.calculator.modelutils
Class WordPartData

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.modelutils.WordPartData

public class WordPartData
extends java.lang.Object

Word part data.

A word part data object holds the data values for a word and its words parts. It is intended primarily for use in WordHoard scripts.

The fields are:


Field Summary
protected  Gender gender
          The gender of the speaker(s).
protected  java.util.ArrayList lemmata
          The lemmata.
protected  java.util.ArrayList lemPos
          The lempos entries.
protected  Mortality mortality
          The mortality of the speaker(s).
protected  java.util.ArrayList pos
          The parts of speech.
protected  Speech speech
          The speech in which this word appears.
protected  Word word
          The word to which this data pertains.
protected  java.util.ArrayList wordClasses
          The word classes.
protected  int wordPartCount
          The number of word parts.
 
Constructor Summary
WordPartData()
          Create empty word part data object.
WordPartData(Word word, Gender gender, Mortality mortality, LemPos[] lemPos, Lemma[] lemmata, Pos[] pos, WordClass[] wordClasses)
          Create word part data object.
WordPartData(Word word, Gender gender, Mortality mortality, LemPos lemPos, Lemma lemma, Pos pos, WordClass wordClass)
          Create word part data object.
 
Method Summary
 void append(LemPos lemPos, Lemma lemma, Pos pos, WordClass wordClass)
          Append data to the existing word part data.
 boolean equals(java.lang.Object obj)
          Returns true if this object is equal to some other object.
 java.lang.String getGender()
          Gets the speaker gender.
 Lemma[] getLemmata()
          Gets the lemmata.
 LemPos[] getLemPos()
          Gets the lemPos entries.
 java.lang.String getMortality()
          Gets the speaker mortality.
 Pos[] getPos()
          Gets the parts of speech.
 Word getWord()
          Gets the Word to which this data pertains.
 WordClass[] getWordClasses()
          Gets the word classes.
 int getWordPartCount()
          Gets the word part count.
 int hashCode()
          Returns a hash code for the object.
 java.lang.String toString()
          Return word tag for display purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

word

protected Word word
The word to which this data pertains.


wordPartCount

protected int wordPartCount
The number of word parts.


speech

protected Speech speech
The speech in which this word appears.


gender

protected Gender gender
The gender of the speaker(s).


mortality

protected Mortality mortality
The mortality of the speaker(s).


lemPos

protected java.util.ArrayList lemPos
The lempos entries.


lemmata

protected java.util.ArrayList lemmata
The lemmata.


pos

protected java.util.ArrayList pos
The parts of speech.


wordClasses

protected java.util.ArrayList wordClasses
The word classes.

Constructor Detail

WordPartData

public WordPartData()
Create empty word part data object.


WordPartData

public WordPartData(Word word,
                    Gender gender,
                    Mortality mortality,
                    LemPos[] lemPos,
                    Lemma[] lemmata,
                    Pos[] pos,
                    WordClass[] wordClasses)
Create word part data object.

Parameters:
word - The word whose data this is.
gender - The combined speaker gender.
mortality - The combined speaker mortality.
lemPos - The lemPos entries.
lemmata - The lemmata.
pos - The parts of speech.
wordClasses - The word classes.

WordPartData

public WordPartData(Word word,
                    Gender gender,
                    Mortality mortality,
                    LemPos lemPos,
                    Lemma lemma,
                    Pos pos,
                    WordClass wordClass)
Create word part data object.

Parameters:
word - The word whose data this is.
gender - The combined speaker gender.
mortality - The combined speaker mortality.
lemPos - The lempos.
lemma - The lemma.
pos - The part of speech.
wordClass - The word class.
Method Detail

getWord

public Word getWord()
Gets the Word to which this data pertains.

Returns:
The word.

getWordPartCount

public int getWordPartCount()
Gets the word part count.

Returns:
Word part count.

getGender

public java.lang.String getGender()
Gets the speaker gender.

Returns:
The speaker gender (M=male, F=female, U=mixed/unknown).

getMortality

public java.lang.String getMortality()
Gets the speaker mortality.

Returns:
The speaker mortality (M=mortal, I=immortal, U=mixed/unknown).

getLemPos

public LemPos[] getLemPos()
Gets the lemPos entries.

Returns:
LemPos entries.

getLemmata

public Lemma[] getLemmata()
Gets the lemmata.

Returns:
Lemmata.

getPos

public Pos[] getPos()
Gets the parts of speech.

Returns:
Parts of speech.

getWordClasses

public WordClass[] getWordClasses()
Gets the word classes.

Returns:
Word classes.

append

public void append(LemPos lemPos,
                   Lemma lemma,
                   Pos pos,
                   WordClass wordClass)
Append data to the existing word part data.

Parameters:
lemPos - The new lemPos.
lemma - The new lemma.
pos - The new part of speech.
wordClass - The new word class.

Note: the updated data is appended to the end of existing entries. The calling method must ensure the data is appended in the proper order.


toString

public java.lang.String toString()
Return word tag for display purposes.

Overrides:
toString in class java.lang.Object
Returns:
Word tag.

equals

public boolean equals(java.lang.Object obj)
Returns true if this object is equal to some other object.

The objects are equal if their word part ordinals are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.