edu.northwestern.at.monk.model
Class PersonCategory

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

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

A person part of speech category.

See Also:
MONK Datastore Overview, Licensing Agreement

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

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

getAll

public static java.util.Collection<PersonCategory> getAll()
Gets all the person categories.

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

find

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

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

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

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

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

sort

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

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

compare

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

Person 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 person category.
cat2 - Second person 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(PersonCategory other)
Compares this instance with another.

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

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