edu.northwestern.at.monk.model
Class Work

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.WorkPart
              extended by edu.northwestern.at.monk.model.Work
All Implemented Interfaces:
Container, java.lang.Comparable<WorkPart>

public class Work
extends WorkPart

A work.

See Also:
MONK Datastore Overview, Licensing Agreement

Nested Class Summary
static class Work.Comparator
          A multi-column work comparator.
static class Work.SortOption
          Work sorting options.
 
Method Summary
static java.util.Collection<Work> find(java.util.Collection criteria)
          Finds works.
static java.util.Collection<Work> find(SearchCriteria criteria)
          Finds works.
static java.util.Collection<Work> find(SearchCriterion... criteria)
          Finds works.
static Work get(java.lang.String tag)
          Gets a work by tag.
static java.util.Collection<Work> getAll()
          Gets all the works.
 java.util.List<Author> getAuthors()
          Gets the authors.
 java.lang.String getAvailability()
          Gets the availability.
 java.lang.Integer getCirculationYear()
          Gets the circulation year.
 Corpus getCorpus()
          Gets the corpus.
 java.lang.String getGenre()
          Gets the genre.
 int getNumAuthors()
          Gets the number of authors.
 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.
 java.lang.String getSubgenre()
          Gets the subgenre.
 SummaryCounts getSummaryCounts()
          Gets the summary counts.
 java.lang.String getTeiHeader()
          Gets the teiHeader for the work part.
static Work[] sort(java.util.Collection<Work> works, Work.SortOption... options)
          Sorts a collection of works.
static void sort(Work[] works, Work.SortOption... options)
          Sorts an array of works.
 
Methods inherited from class edu.northwestern.at.monk.model.WorkPart
compareTo, find, getAdornedXml, getChildren, getDescendants, getHtmlText, getLevel, getNextWorkPartWithText, getNumChildren, getNumSentences, getNumSentencesMain, getNumWordBigrams, getNumWordBigramsMain, getNumWordPartBigrams, getNumWordPartBigramsMain, getNumWordParts, getNumWordPartsMain, getNumWordPartTrigrams, getNumWordPartTrigramsMain, getNumWords, getNumWordsMain, getNumWordTrigrams, getNumWordTrigramsMain, getParent, getPrevWorkPartWithText, getSummaryCount, getSummaryCounts, getSummaryCountsCum, getSummaryCountsNonCum, getTitle, getType, getUnadornedXml, getWordParts, getWords, getWork, getWorkOrdinal, hasChildren, hasText, hasWords, sort, sort
 
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 Work get(java.lang.String tag)
Gets a work by tag.

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

getAll

public static java.util.Collection<Work> getAll()
Gets all the works.

Returns:
Unmodifiable collection of all the works in case-insensitive alphabetical order first by stripped corpus title and then by stripped work title.

find

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

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

Parameters:
criteria - Collection of search criteria.

Note: This parameter should be declared with the type Collection<SearchCriterion>. We have declared it with the type Collection to work around what we think is a bug in Apple's Java compiler version 1.5.0_13. With that compiler, without this change, we get a compile time error message that the reference to the find method is ambiguous, both the find method here and the corresponding find method in the WorkPart class match.

Returns:
Collection of works, 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<Work> find(SearchCriteria criteria)
                                       throws ModelException
Finds works.

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

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

sort

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

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

getCorpus

public Corpus getCorpus()
Gets the corpus.

Returns:
The corpus to which the work belongs.

getCirculationYear

public java.lang.Integer getCirculationYear()
Gets the circulation year.

Returns:
Circulation year, or null if missing.

getGenre

public java.lang.String getGenre()
Gets the genre.

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

getSubgenre

public java.lang.String getSubgenre()
Gets the subgenre.

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

getAvailability

public java.lang.String getAvailability()
Gets the availability.

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

getNumAuthors

public int getNumAuthors()
Gets the number of authors.

Returns:
The number of authors of the work.

getAuthors

public java.util.List<Author> getAuthors()
Gets the authors.

Returns:
An unmodifiable list of all the authors of the work in case-insensitive alphabetical order by name.

getSummaryCounts

public SummaryCounts getSummaryCounts()
Gets the summary counts.

Returns:
The summary counts.

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.

getTeiHeader

public java.lang.String getTeiHeader()
                              throws ModelException
Gets the teiHeader for the work part.

Returns:
The teiHeader for the work part, or null if none.
Throws:
ModelException -
Unable to get XML.