gov.sandia.cognition.text.document
Interface Document

All Superinterfaces:
Named
All Known Implementing Classes:
AbstractDocument, DefaultDocument

public interface Document
extends Named

Defines the interface for a document. A document is composed of several data fields that contain text. It also has a reference describing where it can be located.

Since:
3.0
Author:
Justin Basilico

Method Summary
 Field getAccessedDateField()
          Gets the commonly-used accessed date field.
 Field getAuthorField()
          Gets the commonly-used author field.
 Field getBodyField()
          Gets the commonly-used body field.
 Field getField(String fieldName)
          Gets the field from the document with the given field name, if it exists.
 Collection<Field> getFields()
          Gets the collection of the fields that make up the document.
 Field getLastModifiedDateField()
          Gets the commonly-used last modified date field.
 DocumentReference getReference()
          Gets a reference to the location of the document so that it can be retrieved again later.
 URI getReferenceURI()
          Gets the reference to the location of the document as a URI.
 Field getTitleField()
          Gets the commonly-used title field.
 boolean hasField(String fieldName)
          Determines if this document has a field of the given name.
 
Methods inherited from interface gov.sandia.cognition.util.Named
getName
 

Method Detail

getReference

DocumentReference getReference()
Gets a reference to the location of the document so that it can be retrieved again later. It should be unique and reproducible since it is used to identify this document.

Returns:
The reference to the document.

getReferenceURI

URI getReferenceURI()
Gets the reference to the location of the document as a URI.

Returns:
The document reference as a URI.

getFields

Collection<Field> getFields()
Gets the collection of the fields that make up the document.

Returns:
The collection of fields that make up the document.

hasField

boolean hasField(String fieldName)
Determines if this document has a field of the given name.

Parameters:
fieldName - The name of the field.
Returns:
True if the document has a field of the given name; otherwise, false.

getField

Field getField(String fieldName)
Gets the field from the document with the given field name, if it exists. If not, null is returned.

Parameters:
fieldName - The name of the field.
Returns:
The field with the given name if it exists; otherwise, null.

getTitleField

Field getTitleField()
Gets the commonly-used title field.

Returns:
The title field, if it exists; otherwise, null.

getLastModifiedDateField

Field getLastModifiedDateField()
Gets the commonly-used last modified date field.

Returns:
The last modified date field, if it exists; otherwise, null.

getAccessedDateField

Field getAccessedDateField()
Gets the commonly-used accessed date field.

Returns:
The accessed date field, if it exists; otherwise, null.

getAuthorField

Field getAuthorField()
Gets the commonly-used author field.

Returns:
The author field, if it exists; otherwise, null.

getBodyField

Field getBodyField()
Gets the commonly-used body field. Implementations of the Document interface are highly encouraged to use this field to represent the primary content of the document.

Returns:
The body field, if it exists; otherwise, null.