edu.northwestern.at.monk.model
Class Spelling

java.lang.Object
  extended by edu.northwestern.at.monk.model.TaggedObject
      extended by edu.northwestern.at.monk.model.CoreObject
          extended by edu.northwestern.at.monk.model.Spelling
All Implemented Interfaces:
Feature, java.lang.Comparable<Spelling>

public class Spelling
extends CoreObject
implements Feature, java.lang.Comparable<Spelling>

A spelling.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class Spelling.SortOption
          Spelling sorting options.
 
Method Summary
 int compareTo(Spelling other)
          Compares this instance with another.
static java.util.Collection<Spelling> find(java.util.Collection<SearchCriterion> criteria)
          Finds spellings.
static java.util.Collection<Spelling> find(SearchCriteria criteria)
          Finds spellings.
static java.util.Collection<Spelling> find(SearchCriterion... criteria)
          Finds spellings.
static Spelling get(java.lang.String tag)
          Gets a spelling by tag.
static java.util.Collection<Spelling> getAll()
          Gets all the spellings.
 int getLength()
          Gets the spelling length.
static Spelling[] sort(java.util.Collection<Spelling> collection, Spelling.SortOption... options)
          Sorts a collection of spellings.
static void sort(Spelling[] array, Spelling.SortOption... options)
          Sorts an array of spellings.
 
Methods inherited from class edu.northwestern.at.monk.model.TaggedObject
getTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static Spelling get(java.lang.String tag)
Gets a spelling by tag.

Parameters:
tag - Tag.
Returns:
Spelling, or null if none.

getAll

public static java.util.Collection<Spelling> getAll()
Gets all the spellings.

Returns:
Unmodifiable collection of all the spellings in case and diacritical-insensitive alphabetical order by tag.

find

public static java.util.Collection<Spelling> find(SearchCriterion... criteria)
                                           throws ModelException
Finds spellings.

Parameters:
criteria - Search criteria.
Returns:
Collection of spellings, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

find

public static java.util.Collection<Spelling> find(java.util.Collection<SearchCriterion> criteria)
                                           throws ModelException
Finds spellings.

Parameters:
criteria - Collection of search criteria.
Returns:
Collection of spellings, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

find

public static java.util.Collection<Spelling> find(SearchCriteria criteria)
                                           throws ModelException
Finds spellings.

Parameters:
criteria - Search criteria.
Returns:
Collection of spellings, in an undefined order. If you want the result to be ordered, you must call a sort method.
Throws:
ModelException -
Unable to execute search

sort

public static void sort(Spelling[] array,
                        Spelling.SortOption... options)
Sorts an array of spellings.

Parameters:
array - Array of spellings.
options - Sort options, or null to use the natural ordering.

sort

public static Spelling[] sort(java.util.Collection<Spelling> collection,
                              Spelling.SortOption... options)
Sorts a collection of spellings.

Parameters:
collection - Collection of spellings.
options - Sort options, or null to use the natural ordering.
Returns:
Sorted array of spellings.

getLength

public int getLength()
Gets the spelling length.

Returns:
The length of the spelling.

compareTo

public int compareTo(Spelling other)
Compares this instance with another.

Spellings are ordered in case and diacritical-insensitve increasing alphabetical order by tag.

Specified by:
compareTo in interface java.lang.Comparable<Spelling>
Parameters:
other - The other instance to be compared.
Returns:
A negative integer, zero, or a positive integer as this instance is less than, equal to, or greater than the specified instance.