edu.northwestern.at.wordhoard.model.wrappers
Class Narrative

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.wrappers.Narrative
All Implemented Interfaces:
GroupingObject, SearchCriterion

public class Narrative
extends java.lang.Object
implements SearchCriterion, GroupingObject

A narrative attribute wrapper.


Field Summary
static byte NARRATION
          Narration.
static Narrative NARRATION_OBJECT
          Narration object.
static byte NUM_NARRATIVE
          Number of narrative attributes.
static byte SPEECH
          Speech.
static Narrative SPEECH_OBJECT
          Speech object.
 
Constructor Summary
Narrative(byte narrative)
          Creates a new narrative attribute wrapper.
 
Method Summary
 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.
 byte getNarrative()
          Gets the narrative attribute.
 java.lang.String getReportPhrase()
          Gets the report phrase.
 java.lang.String getWhereClause()
          Gets the Hibernate where clause.
 int hashCode()
          Returns a hash code for the object.
 boolean isNarration()
          Returns true if narration.
 boolean isSpeech()
          Returns true if speech.
 void setArg(org.hibernate.Query q, org.hibernate.Session session)
          Sets the Hibernate query argument.
 java.lang.String toString()
          Returns a string representation of the narrative attribute.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NARRATION

public static final byte NARRATION
Narration.

See Also:
Constant Field Values

SPEECH

public static final byte SPEECH
Speech.

See Also:
Constant Field Values

NARRATION_OBJECT

public static final Narrative NARRATION_OBJECT
Narration object.


SPEECH_OBJECT

public static final Narrative SPEECH_OBJECT
Speech object.


NUM_NARRATIVE

public static final byte NUM_NARRATIVE
Number of narrative attributes.

See Also:
Constant Field Values
Constructor Detail

Narrative

public Narrative(byte narrative)
Creates a new narrative attribute wrapper.

Parameters:
narrative - The narrative attribute.
Method Detail

getNarrative

public byte getNarrative()
Gets the narrative attribute.

Returns:
The narrative attribute.

isNarration

public boolean isNarration()
Returns true if narration.

Returns:
True if narration, false if speech.

isSpeech

public boolean isSpeech()
Returns true if speech.

Returns:
True if speech, false if narration.

getJoinClass

public java.lang.Class getJoinClass()
Gets the join class.

Specified by:
getJoinClass in interface SearchCriterion
Returns:
The join class, or null if none.

getWhereClause

public java.lang.String getWhereClause()
Gets the Hibernate where clause.

Specified by:
getWhereClause in interface SearchCriterion
Returns:
The Hibernate where clause.

setArg

public void setArg(org.hibernate.Query q,
                   org.hibernate.Session session)
Sets the Hibernate query argument.

Specified by:
setArg in interface SearchCriterion
Parameters:
q - Hibernate query.
session - Hibernate session.

appendDescription

public void appendDescription(TextLine line,
                              FontInfo romanFontInfo,
                              FontInfo[] fontInfo)
Appends a description to a text line.

Specified by:
appendDescription in interface SearchCriterion
Parameters:
line - Text line.
romanFontInfo - Roman font info.
fontInfo - Array of font info indexed by character set.

getReportPhrase

public java.lang.String getReportPhrase()
Gets the report phrase.

Specified by:
getReportPhrase in interface GroupingObject
Returns:
The report phrase "in".

getGroupingSpelling

public Spelling getGroupingSpelling(int numHits)
Gets the spelling of the grouping object.

Specified by:
getGroupingSpelling in interface GroupingObject
Parameters:
numHits - Number of hits.
Returns:
The spelling of the grouping object.

toString

public java.lang.String toString()
Returns a string representation of the narrative attribute.

Overrides:
toString in class java.lang.Object
Returns:
String representation.

equals

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

Specified by:
equals in interface GroupingObject
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.

Specified by:
hashCode in interface GroupingObject
Overrides:
hashCode in class java.lang.Object
Returns:
The hash code.