org.sciplore.resources
Class Citation

java.lang.Object
  extended by org.sciplore.resources.Resource
      extended by org.sciplore.resources.Citation

@Entity
public class Citation
extends Resource

Resource class for citations.

Author:
Mario Lipinski <lipinski@sciplore.org>
See Also:
Resource

Constructor Summary
Citation()
           
 
Method Summary
static Citation getCitation(Citation c)
          Returns a matching Citation object from the database for an Citation object.
static Citation getCitation(Document cited, Document citing, Integer chapter, Integer character, Integer paragraph, Integer sentence, Integer word)
          Returns a Citation object from the database for a cited Document, a citing Document, a chapter cound, a character count, a paragraph count, a sentence count and a word count.
static Citation getCitation(Integer id)
          Returns a Citation object from the database for an identifier.
static List<Citation> getCitations()
          Returns a list of all citations in database.
 Document getCitedDocument()
          Returns the cited Document.
 Document getCitingDocument()
          Returns the cititing Document.
 String getContext()
          Returns the context.
 Integer getCountChapter()
          Returns the chapter count.
 Integer getCountCharacter()
          Returns the character count.
 Integer getCountParagraph()
          Returns the paragraph count.
 Integer getCountSentence()
          Returns the sentence count.
 Integer getCountWord()
          Returns the word count.
 Integer getId()
          Returns the identifier.
 void setCitedDocument(Document citedDocument)
          Sets the cited Document.
 void setCitingDocument(Document citingDocument)
          Sets the cititing Document.
 void setContext(String context)
          Sets the context.
 void setCountChapter(Integer countChapter)
          Sets the chapter count.
 void setCountCharacter(Integer countCharacter)
          Sets the character count.
 void setCountParagraph(Integer countParagraph)
          Sets the paragraph count.
 void setCountSentence(Integer countSentence)
          Sets the sentence count.
 void setCountWord(Integer countWord)
          Sets the word count.
 void setId(Integer id)
          Sets the identifier.
static Citation sync(Citation cit)
          Synchronizes a Citation object with a record from the database.
 
Methods inherited from class org.sciplore.resources.Resource
save
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Citation

public Citation()
Method Detail

getCitation

public static Citation getCitation(Citation c)
Returns a matching Citation object from the database for an Citation object.

Parameters:
c - the Citation object
Returns:
the Citation object from the database or null if not found

getCitation

public static Citation getCitation(Integer id)
Returns a Citation object from the database for an identifier.

Parameters:
id - the identifier
Returns:
the Citation object or null if not found

getCitation

public static Citation getCitation(Document cited,
                                   Document citing,
                                   Integer chapter,
                                   Integer character,
                                   Integer paragraph,
                                   Integer sentence,
                                   Integer word)
Returns a Citation object from the database for a cited Document, a citing Document, a chapter cound, a character count, a paragraph count, a sentence count and a word count.

Parameters:
cited - the cited Document
citing - the citing Document
chapter - the chapter count
character - the character count
paragraph - the paragraph count
sentence - the sentence count
word - the word count
Returns:
the Citation object or null if not found
See Also:
Document

getCitations

public static List<Citation> getCitations()
Returns a list of all citations in database.

Returns:
all citations.

sync

public static Citation sync(Citation cit)
Synchronizes a Citation object with a record from the database. If the object does not exist, it is added to the database. In any case related objects are synchronized as well.

Parameters:
cit - the citation
Returns:
synchronized Citation which is stored in the database

getCitedDocument

public Document getCitedDocument()
Returns the cited Document.

Returns:
the cited Document

getCitingDocument

public Document getCitingDocument()
Returns the cititing Document.

Returns:
the citing Document

getContext

public String getContext()
Returns the context.

Returns:
the context

getCountChapter

public Integer getCountChapter()
Returns the chapter count.

Returns:
the chapter count

getCountCharacter

public Integer getCountCharacter()
Returns the character count.

Returns:
the character count

getCountParagraph

public Integer getCountParagraph()
Returns the paragraph count.

Returns:
the paragraph count

getCountSentence

public Integer getCountSentence()
Returns the sentence count.

Returns:
the sentence count

getCountWord

public Integer getCountWord()
Returns the word count.

Returns:
the word count

getId

public Integer getId()
Returns the identifier.

Returns:
the iddentifier

setCitedDocument

public void setCitedDocument(Document citedDocument)
Sets the cited Document.

Parameters:
citedDocument - the cited Document

setCitingDocument

public void setCitingDocument(Document citingDocument)
Sets the cititing Document.

Parameters:
citingDocument - the citing Document

setContext

public void setContext(String context)
Sets the context.

Parameters:
context - the context

setCountChapter

public void setCountChapter(Integer countChapter)
Sets the chapter count.

Parameters:
countChapter - the chapter count

setCountCharacter

public void setCountCharacter(Integer countCharacter)
Sets the character count.

Parameters:
countCharacter - the character count

setCountParagraph

public void setCountParagraph(Integer countParagraph)
Sets the paragraph count.

Parameters:
countParagraph - the paragraph count

setCountSentence

public void setCountSentence(Integer countSentence)
Sets the sentence count.

Parameters:
countSentence - the sentence count

setCountWord

public void setCountWord(Integer countWord)
Sets the word count.

Parameters:
countWord - the word count

setId

public void setId(Integer id)
Sets the identifier.

Parameters:
id - the identifier