edu.northwestern.at.monk.model
Class WordClass

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.WordClass
All Implemented Interfaces:
Feature, java.lang.Comparable<WordClass>

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

A word class.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class WordClass.Comparator
          A multi-column word class comparator.
static class WordClass.SortOption
          Word class sorting options.
 
Method Summary
 int compareTo(WordClass other)
          Compares this instance with another.
static java.util.Collection<WordClass> find(java.util.Collection<SearchCriterion> criteria)
          Finds word classes.
static java.util.Collection<WordClass> find(SearchCriteria criteria)
          Finds word classes.
static java.util.Collection<WordClass> find(SearchCriterion... criteria)
          Finds word classes.
static WordClass get(java.lang.String tag)
          Gets a word class by tag.
static java.util.Collection<WordClass> getAll()
          Gets all the word classes.
 java.lang.String getDescription()
          Gets the description.
 MajorWordClass getMajorWordClass()
          Gets the major word class.
static WordClass[] sort(java.util.Collection<WordClass> collection, WordClass.SortOption... options)
          Sorts a collection of word classes.
static void sort(WordClass[] array, WordClass.SortOption... options)
          Sorts an array of word classes.
 
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 WordClass get(java.lang.String tag)
Gets a word class by tag.

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

getAll

public static java.util.Collection<WordClass> getAll()
Gets all the word classes.

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

find

public static java.util.Collection<WordClass> find(SearchCriterion... criteria)
                                            throws ModelException
Finds word classes.

Parameters:
criteria - Search criteria.
Returns:
Collection of word classes, 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<WordClass> find(java.util.Collection<SearchCriterion> criteria)
                                            throws ModelException
Finds word classes.

Parameters:
criteria - Collection of search criteria.
Returns:
Collection of word classes, 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<WordClass> find(SearchCriteria criteria)
                                            throws ModelException
Finds word classes.

Parameters:
criteria - Search criteria.
Returns:
Collection of word classes, 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(WordClass[] array,
                        WordClass.SortOption... options)
Sorts an array of word classes.

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

sort

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

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

getDescription

public java.lang.String getDescription()
Gets the description.

Returns:
A description of the word class.

getMajorWordClass

public MajorWordClass getMajorWordClass()
Gets the major word class.

Returns:
The major word class.

compareTo

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

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

Specified by:
compareTo in interface java.lang.Comparable<WordClass>
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.