edu.northwestern.at.wordhoard.model.grouping
Interface GroupingObject

All Known Implementing Classes:
Author, CollectionFrequency, Corpus, DateGroup, DocFrequency, FollowingWordForm, Gender, Lemma, MajorWordClass, MetricalShape, Mortality, Narrative, NoneOfTheAbove, Pos, PrecedingWordForm, Prosodic, PubDecade, PubYearRange, Speaker, SpeakerName, Spelling, WordClass, Work, WorkPart

public interface GroupingObject

A grouping object.

Grouping objects are used to aggregate (group) search results.

Grouping objects are used as map keys, so they must implement the equals and hashCode methods.


Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if this object equals some other object.
 Spelling getGroupingSpelling(int numHits)
          Gets the spelling of the grouping object.
 java.lang.String getReportPhrase()
          Gets the report phrase.
 int hashCode()
          Returns a hash code for the object.
 

Method Detail

getReportPhrase

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

This phrase is used in search result reports. E.g., for works the phrase is "in", while for lemmas the phrase is "with lemma".

Returns:
The report phrase.

getGroupingSpelling

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

Parameters:
numHits - Number of hits. The method may use this parameter if it needs to return a singular (numHits = 1) versus a plural (numHit > 1) form.
Returns:
The spelling of the grouping object.

equals

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

Grouping objects must implement the equals method.

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

hashCode

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

Grouping objects must implement the hashCode method.

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