edu.northwestern.at.monk.model
Class Author

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

public class Author
extends CoreObject
implements Container, java.lang.Comparable<Author>

An author.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class Author.Comparator
          A multi-column author comparator.
static class Author.SortOption
          Author sorting options.
 
Method Summary
 int compareTo(Author other)
          Compares this instance with another.
static java.util.Collection<Author> find(java.util.Collection<SearchCriterion> criteria)
          Finds authors.
static java.util.Collection<Author> find(SearchCriteria criteria)
          Finds authors.
static java.util.Collection<Author> find(SearchCriterion... criteria)
          Finds authors.
static Author get(java.lang.String tag)
          Gets an author by tag.
static java.util.Collection<Author> getAll()
          Gets all the authors.
 java.lang.Integer getBirthYear()
          Gets the birth year.
 java.util.Collection<Corpus> getCorpora()
          Gets the corpora.
 java.lang.Integer getDeathYear()
          Gets the death year.
 java.lang.String getFlourished()
          Gets the flourished attribute.
 java.lang.String getGender()
          Gets the gender.
 java.lang.String getName()
          Gets the name.
 int getNumCorpora()
          Gets the number of corpora.
 long getNumSentences()
          Gets the number of sentences.
 long getNumSentencesMain()
          Gets the number of sentences in main text.
 long getNumWordBigrams()
          Gets the number of word bigrams.
 long getNumWordBigramsMain()
          Gets the number of word bigrams in main text.
 long getNumWordPartBigrams()
          Gets the number of word part bigrams.
 long getNumWordPartBigramsMain()
          Gets the number of word part bigrams in main text.
 long getNumWordParts()
          Gets the number of word parts.
 long getNumWordPartsMain()
          Gets the number of word parts in main text.
 long getNumWordPartTrigrams()
          Gets the number of word part trigrams.
 long getNumWordPartTrigramsMain()
          Gets the number of word part trigrams in main text.
 long getNumWords()
          Gets the number of words.
 long getNumWordsMain()
          Gets the number of words in main text.
 long getNumWordTrigrams()
          Gets the number of word trigrams.
 long getNumWordTrigramsMain()
          Gets the number of word trigrams in main text.
 int getNumWorks()
          Gets the number of works.
 java.lang.String getOrigin()
          Gets the origin.
 long getSummaryCount(CumKind cumKind, FeatureKind featureKind, Arity arity, MainKind mainKind)
          Gets a summary count.
 SummaryCounts getSummaryCounts()
          Gets the summary counts.
 SummaryCounts getSummaryCounts(CumKind cumKind)
          Gets the summary counts.
 java.util.Collection<Work> getWorks()
          Gets the works.
static void sort(Author[] array, Author.SortOption... options)
          Sorts an array of authors.
static Author[] sort(java.util.Collection<Author> collection, Author.SortOption... options)
          Sorts a collection of authors.
 
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 Author get(java.lang.String tag)
Gets an author by tag.

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

getAll

public static java.util.Collection<Author> getAll()
Gets all the authors.

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

find

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

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

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

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

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

sort

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

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

getName

public java.lang.String getName()
Gets the name.

Returns:
The author's name.

getBirthYear

public java.lang.Integer getBirthYear()
Gets the birth year.

Returns:
The author's birth year, or null if unknown.

getDeathYear

public java.lang.Integer getDeathYear()
Gets the death year.

Returns:
The author's death year, or null if unknown.

getFlourished

public java.lang.String getFlourished()
Gets the flourished attribute.

Returns:
The flourished attribute. May be the empty string but is never null.

getOrigin

public java.lang.String getOrigin()
Gets the origin.

Returns:
Origin. May be the empty string but is never null.

getGender

public java.lang.String getGender()
Gets the gender.

Returns:
Gender. May be the empty string but is never null.

getNumWorks

public int getNumWorks()
Gets the number of works.

Returns:
The number of works by the author.

getWorks

public java.util.Collection<Work> getWorks()
Gets the works.

Returns:
An unmodifiiable collection of all the works by the author in case and diacritical-insensitive alphabetical order first by corpus title and then by work title.

getNumCorpora

public int getNumCorpora()
Gets the number of corpora.

Returns:
The number of corpora in which the author has works.

getCorpora

public java.util.Collection<Corpus> getCorpora()
Gets the corpora.

Returns:
An unmodifiiable collection of all the corpora in which the author has works, in case and diacritical-insensitive alphabetical order by corpus title.

getSummaryCounts

public SummaryCounts getSummaryCounts()
Gets the summary counts.

Returns:
The summary counts.

getSummaryCounts

public SummaryCounts getSummaryCounts(CumKind cumKind)
Gets the summary counts.

Specified by:
getSummaryCounts in interface Container
Parameters:
cumKind - Kind of count: CumKind.CUM or CumKind.NON_CUM. (Ignored.)
Returns:
The summary counts.

getSummaryCount

public long getSummaryCount(CumKind cumKind,
                            FeatureKind featureKind,
                            Arity arity,
                            MainKind mainKind)
Gets a summary count.

Specified by:
getSummaryCount in interface Container
Parameters:
cumKind - Kind of count: CumKind.CUM or CumKind.NON_CUM. (Ignored.)
featureKind - Feature kind: FeatureKind.WORD or FeatureKind.WORD_PART.
arity - Arity: Arity.UNIGRAM, Arity.BIGRAM or Arity.TRIGRAM.
mainKind - Main kind: MainKind.ALL_TEXT or MainKind.MAIN_TEXT.
Returns:
Summary count.

getNumWords

public long getNumWords()
Gets the number of words.

Returns:
The number of words.

getNumWordsMain

public long getNumWordsMain()
Gets the number of words in main text.

Returns:
The number of words in main text.

getNumWordBigrams

public long getNumWordBigrams()
Gets the number of word bigrams.

Returns:
The number of word bigrams.

getNumWordBigramsMain

public long getNumWordBigramsMain()
Gets the number of word bigrams in main text.

Returns:
The number of word bigrams in main text.

getNumWordTrigrams

public long getNumWordTrigrams()
Gets the number of word trigrams.

Returns:
The number of word trigrams.

getNumWordTrigramsMain

public long getNumWordTrigramsMain()
Gets the number of word trigrams in main text.

Returns:
The number of word trigrams in main text.

getNumWordParts

public long getNumWordParts()
Gets the number of word parts.

Returns:
The number of word parts.

getNumWordPartsMain

public long getNumWordPartsMain()
Gets the number of word parts in main text.

Returns:
The number of word parts in main text.

getNumWordPartBigrams

public long getNumWordPartBigrams()
Gets the number of word part bigrams.

Returns:
The number of word part bigrams.

getNumWordPartBigramsMain

public long getNumWordPartBigramsMain()
Gets the number of word part bigrams in main text.

Returns:
The number of word part bigrams in main text.

getNumWordPartTrigrams

public long getNumWordPartTrigrams()
Gets the number of word part trigrams.

Returns:
The number of word part trigrams.

getNumWordPartTrigramsMain

public long getNumWordPartTrigramsMain()
Gets the number of word part trigrams in main text.

Returns:
The number of word part trigrams in main text.

getNumSentences

public long getNumSentences()
Gets the number of sentences.

Returns:
The number of sentences.

getNumSentencesMain

public long getNumSentencesMain()
Gets the number of sentences in main text.

Returns:
The number of sentences in main text.

compareTo

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

Authors are ordered in case and diacritical-insensitve increasing alphabetical order by name.

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