|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.model.userdata.Phrase
public class Phrase
A phrase.
A phrase contains an ordered list of adjacent words.
Field Summary | |
---|---|
protected java.lang.Long |
id
Unique persistence id (primary key). |
protected int |
tagsHashCode
A hash code for the word tags. |
protected java.util.List |
wordTags
The words in the phrase, in order. |
protected java.lang.String |
workTag
The tag of the work in which this phrase occurs. |
Constructor Summary | |
---|---|
Phrase()
Create an empty phrase. |
|
Phrase(java.lang.String[] wordTags,
java.lang.String workTag)
Create a phrase with specified word tags. |
|
Phrase(Word[] words)
Create a phrase with specified words. |
Method Summary | |
---|---|
protected void |
addWordTags(java.lang.String[] wordTags,
java.lang.String workTag)
Add word tags. |
void |
clear()
Clears the phrase. |
boolean |
equals(java.lang.Object obj)
Returns true if some other phrase is equal to this one. |
java.lang.Long |
getId()
Gets the unique id. |
java.lang.String |
getTag()
Gets a tag for the phrase. |
protected int |
getTagsHashCode()
Get hash code for word tags. |
java.util.List |
getWordTags()
Gets word tags. |
java.lang.String |
getWorkTag()
Get work tag. |
int |
hashCode()
Returns a hash code for the object. |
java.lang.String |
toString()
Gets a string representation of the phrase. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Long id
protected java.util.List wordTags
protected java.lang.String workTag
protected int tagsHashCode
Constructor Detail |
---|
public Phrase()
public Phrase(Word[] words)
words
- The words in the phrase. public Phrase(java.lang.String[] wordTags, java.lang.String workTag)
wordTags
- The word tags of the words in the phrase. Method Detail |
---|
protected void addWordTags(java.lang.String[] wordTags, java.lang.String workTag)
wordTags
- The word tags of the words in the phrase.workTag
- The work tag for the words. public java.lang.Long getId()
public java.util.List getWordTags()
public java.lang.String getWorkTag()
protected int getTagsHashCode()
public void clear()
public java.lang.String getTag()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
The two phrases are equal if their word tag lists are equal.
equals
in class java.lang.Object
obj
- The other object.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |