edu.northwestern.at.monk.model
Class CaseCategory

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

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

A case part of speech category.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class CaseCategory.Comparator
          A multi-column case category comparator.
static class CaseCategory.SortOption
          Case category sorting options.
 
Method Summary
static int compare(CaseCategory cat1, CaseCategory cat2)
          Compares two case categories with null values permitted.
 int compareTo(CaseCategory other)
          Compares this instance with another.
static java.util.Collection<CaseCategory> find(java.util.Collection<SearchCriterion> criteria)
          Finds case categories.
static java.util.Collection<CaseCategory> find(SearchCriteria criteria)
          Finds case categories.
static java.util.Collection<CaseCategory> find(SearchCriterion... criteria)
          Finds case categories.
static CaseCategory get(java.lang.String tag)
          Gets a case category by tag.
static java.util.Collection<CaseCategory> getAll()
          Gets all the case categories.
static void sort(CaseCategory[] array, CaseCategory.SortOption... options)
          Sorts an array of case categories.
static CaseCategory[] sort(java.util.Collection<CaseCategory> collection, CaseCategory.SortOption... options)
          Sorts a collection of case categories.
 
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 CaseCategory get(java.lang.String tag)
Gets a case category by tag.

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

getAll

public static java.util.Collection<CaseCategory> getAll()
Gets all the case categories.

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

find

public static java.util.Collection<CaseCategory> find(SearchCriterion... criteria)
                                               throws ModelException
Finds case categories.

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

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

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

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

sort

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

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

compare

public static int compare(CaseCategory cat1,
                          CaseCategory cat2)
Compares two case categories with null values permitted.

Case categories are ordered in case and diacritical-insensitve increasing alphabetical order by tag. Null values are equal to each other but greater than all other values.

Parameters:
cat1 - First case category.
cat2 - Second case category.
Returns:
A negative integer, zero, or a positive integer as this instance is less than, equal to, or greater than the specified instance.

compareTo

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

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

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