|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.northwestern.at.wordhoard.model.userdata.WordSet
edu.northwestern.at.wordhoard.model.userdata.PhraseSet
public class PhraseSet
A phrase set.
A phrase set contains a list of phrases. Typically these come from various works and do not necessarily appear sequentially.
Each phrase set has the following attributes in addition to those defined
for word sets.
phrases.
| Field Summary | |
|---|---|
protected java.util.Collection |
phrases
Collection of phrases belonging to this phrase set. |
protected double |
sumPhraseLengths
Sum of the phrase lengths. |
| Fields inherited from class edu.northwestern.at.wordhoard.model.userdata.WordSet |
|---|
creationTime, description, id, isActive, isPublic, modificationTime, owner, query, serialVersionUID, title, webPageURL, wordTags, workPartTags, workTags |
| Constructor Summary | |
|---|---|
PhraseSet()
Create an empty phrase set. |
|
PhraseSet(org.w3c.dom.Node phraseSetNode,
java.lang.String owner)
Create a phrase set from a DOM document node. |
|
PhraseSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
java.lang.String owner,
boolean isPublic)
Create an empty phrase set with a specified name. |
|
PhraseSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
java.lang.String owner,
boolean isPublic,
java.lang.String query)
Create an empty phrase set with a specified name and query string. |
|
| Method Summary | |
|---|---|
void |
addPhrase(Phrase phrase)
Adds a phrase. |
void |
addPhrases(java.util.Collection phraseCollection)
Adds phrases from a collection of phrases. |
void |
addPhrases(Phrase[] phraseArray)
Adds phrases from an array of phrases. |
boolean |
addToDOMDocument(org.w3c.dom.Document document)
Add phrase set to DOM document. |
void |
appendDescription(TextLine line,
FontInfo romanFontInfo,
FontInfo[] fontInfo)
Appends a description to a text line. |
boolean |
equals(java.lang.Object obj)
Returns true if some other object is equal to this one. |
Spelling |
getGroupingSpelling(int numHits)
Gets the spelling of the grouping object. |
java.lang.Class |
getJoinClass()
Gets the join class. |
double |
getMeanPhraseLength()
Get mean phrase length. |
int |
getPhraseCount()
Get the number of phrases. |
java.util.Collection |
getPhrases()
Get the phrases. |
java.lang.String |
getReportPhrase()
Gets the report phrase. |
SearchCriterion |
getSearchDefault(java.lang.Class cls)
Gets a search criterion default value. |
double |
getSumPhraseLengths()
Get sum of the phrase lengths. |
java.lang.String |
getWhereClause()
Gets the Hibernate where clause. |
int |
hashCode()
Returns a hash code for the object. |
void |
removePhrases()
Removes all the phrases. |
void |
setArg(org.hibernate.Query q,
org.hibernate.Session session)
Sets the Hibernate query argument. |
boolean |
setFromDOMDocumentNode(org.w3c.dom.Node phraseSetNode)
Set values from DOM document node. |
java.lang.String |
toString()
Gets a string representation of the phrase set. |
java.lang.String |
toStringDetailed()
Gets a detailed string representation of the phrase set. |
| Methods inherited from class edu.northwestern.at.wordhoard.model.userdata.WordSet |
|---|
addWord, addWords, addWords, addWordTags, addWordTags, addWorkPartTags, addWorkTags, getCreationTime, getDescription, getId, getIsActive, getIsPublic, getModificationTime, getOwner, getQuery, getTitle, getWebPageURL, getWordTags, getWorkPartTags, getWorkTags, readExternal, removeWords, setCreationTime, setDescription, setIsActive, setIsPublic, setModificationTime, setOwner, setQuery, setTitle, setWebPageURL, writeExternal |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.northwestern.at.wordhoard.model.PersistentObject |
|---|
getId |
| Methods inherited from interface edu.northwestern.at.wordhoard.model.userdata.UserDataObject |
|---|
getCreationTime, getDescription, getId, getIsActive, getIsPublic, getModificationTime, getOwner, getQuery, getTitle, getWebPageURL, setCreationTime, setDescription, setModificationTime, setTitle, setWebPageURL |
| Field Detail |
|---|
protected java.util.Collection phrases
Element type is Phrase.
protected double sumPhraseLengths
| Constructor Detail |
|---|
public PhraseSet()
public PhraseSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
java.lang.String owner,
boolean isPublic)
title - The phrase set's title.description - The phrase set's description.webPageURL - The phrase set's web page URL.owner - The phrase set's owner.isPublic - True if the phrase set is public.
public PhraseSet(java.lang.String title,
java.lang.String description,
java.lang.String webPageURL,
java.lang.String owner,
boolean isPublic,
java.lang.String query)
title - The phrase set's title.description - The phrase set's description.webPageURL - The phrase set's web page URL.owner - The phrase set's owner.isPublic - True if the phrase set is public.query - Query properties for generating this phrase set.
public PhraseSet(org.w3c.dom.Node phraseSetNode,
java.lang.String owner)
phraseSetNode - The root node for the phrase set.owner - The phrase set's owner. | Method Detail |
|---|
public java.util.Collection getPhrases()
public double getSumPhraseLengths()
public double getMeanPhraseLength()
The average phrase length is the sum of the phrase lengths divided by the number of phrases.
public int getPhraseCount()
public void addPhrase(Phrase phrase)
phrase - The phrase to add.
The words and works are updated as needed.
public void addPhrases(Phrase[] phraseArray)
phraseArray - The phrases as an array.
The word, work, and work part collections are also updated as needed.
public void addPhrases(java.util.Collection phraseCollection)
phraseCollection - The phrases as a collection.
The work and work part collection are also updated as needed.
public void removePhrases()
All words, work parts, and works are also removed.
public boolean addToDOMDocument(org.w3c.dom.Document document)
addToDOMDocument in interface UserDataObjectaddToDOMDocument in class WordSetdocument - DOM document to which to add phrase set.
Must not be null. In most cases,
this document should have a "wordhoard"
node as the root element.
public boolean setFromDOMDocumentNode(org.w3c.dom.Node phraseSetNode)
setFromDOMDocumentNode in interface UserDataObjectsetFromDOMDocumentNode in class WordSetphraseSetNode - DOM document node with phrase set settings.
public java.lang.String toString()
toString in class WordSetpublic java.lang.String toStringDetailed()
toStringDetailed in class WordSetpublic SearchCriterion getSearchDefault(java.lang.Class cls)
getSearchDefault in class WordSetcls - Model class of search criterion.
public java.lang.Class getJoinClass()
getJoinClass in interface SearchCriteriongetJoinClass in class WordSetpublic java.lang.String getWhereClause()
getWhereClause in interface SearchCriteriongetWhereClause in class WordSet
public void setArg(org.hibernate.Query q,
org.hibernate.Session session)
setArg in interface SearchCriterionsetArg in class WordSetq - Hibernate query.session - Hibernate session.
public void appendDescription(TextLine line,
FontInfo romanFontInfo,
FontInfo[] fontInfo)
appendDescription in interface SearchCriterionappendDescription in class WordSetline - Text line.romanFontInfo - Roman font info.fontInfo - Array of font info indexed by character
set. public java.lang.String getReportPhrase()
getReportPhrase in class WordSetpublic Spelling getGroupingSpelling(int numHits)
getGroupingSpelling in class WordSetnumHits - Number of hits.
public boolean equals(java.lang.Object obj)
The two objects are equal if their ids are equal.
equals in class WordSetobj - The other object.
public int hashCode()
hashCode in class WordSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||