edu.northwestern.at.wordhoard.model.search
Class SpellingWithCollationStrength

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.search.SpellingWithCollationStrength
All Implemented Interfaces:
SearchCriterion

public class SpellingWithCollationStrength
extends java.lang.Object
implements SearchCriterion

A spelling with a collation strength search criterion.


Constructor Summary
SpellingWithCollationStrength(Spelling spelling, int strength)
          Creates a new spelling with collation strength object.
 
Method Summary
 void appendDescription(TextLine line, FontInfo romanFontInfo, FontInfo[] fontInfo)
          Appends a description to a text line.
 int compareTo(java.lang.Object obj)
          Implement Comparable interface.
 boolean equals(java.lang.Object obj)
          Returns true if this object is equal to some other object.
 java.lang.Class getJoinClass()
          Gets the join class.
 Spelling getSpelling()
          Gets the spelling.
 int getStrength()
          Gets the collation strength.
 java.lang.String getWhereClause()
          Gets the Hibernate where clause.
 int hashCode()
          Returns a hash code for the object.
 void setArg(org.hibernate.Query q, org.hibernate.Session session)
          Sets the Hibernate query argument.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpellingWithCollationStrength

public SpellingWithCollationStrength(Spelling spelling,
                                     int strength)
Creates a new spelling with collation strength object.

The collation strengths are:

Parameters:
spelling - Spelling. Each run of wild card '*' characters is replaced by a single '*' character.
strength - Collation strength.
Method Detail

getSpelling

public Spelling getSpelling()
Gets the spelling.

Returns:
The spelling.

getStrength

public int getStrength()
Gets the collation strength.

Returns:
The collation strength.

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.

equals

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

The SpellingWithCollationStrength are equal if their strings are identical and they have the same character set and their collation strength is the same.

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.

compareTo

public int compareTo(java.lang.Object obj)
Implement Comparable interface.

Parameters:
obj - Other spelling object to which to compare this object.