anl.aida.reader
Class ReaderResult

java.lang.Object
  extended by anl.aida.reader.ReaderResult

public class ReaderResult
extends java.lang.Object

The result of parsing a document with a reader. This makes the parsed metadata available. It also includes some basic error checking.


Nested Class Summary
static class ReaderResult.Error
           
 
Field Summary
private  ParsedAuthors authors
           
private  java.lang.String contents
           
private  ParsedDate date
           
private  java.lang.String link
           
private  java.lang.String location
           
private  java.lang.String source
           
private  java.lang.String title
           
 
Constructor Summary
ReaderResult()
           
ReaderResult(ReaderResult result)
           
 
Method Summary
 ParsedAuthors getAuthors()
          Gets the authors.
 java.lang.String getContents()
          Gets the contents of the document.
 ParsedDate getDate()
          Gets the parsed Date.
 java.lang.String getLink()
          Gets an additional link provided by the document (if available).
 java.lang.String getLocation()
          Gets the location (e.g.
 java.lang.String getSource()
          Gets the source of the document (e.g.
 java.lang.String getTitle()
          Gets the title.
 ReaderResult.Error isValid()
          Checks whether this ReaderResult is valid.
 ReaderResult.Error process(DocumentMetaData data, org.apache.uima.jcas.JCas cas)
          Fills in the DocumentMetaData from the results using the specified cas.
 void setAuthors(ParsedAuthors authors)
           
 void setContents(java.lang.String contents)
           
 void setDate(ParsedDate date)
           
 void setLink(java.lang.String link)
           
 void setLocation(java.lang.String location)
           
 void setSource(java.lang.String source)
           
 void setTitle(java.lang.String title)
           
 java.lang.String toString()
          Gets a formatted String representation of this ReaderResult.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

date

private ParsedDate date

authors

private ParsedAuthors authors

title

private java.lang.String title

location

private java.lang.String location

link

private java.lang.String link

source

private java.lang.String source

contents

private java.lang.String contents
Constructor Detail

ReaderResult

public ReaderResult()

ReaderResult

public ReaderResult(ReaderResult result)
Method Detail

getDate

public ParsedDate getDate()
Gets the parsed Date.

Returns:
the parsed Date.

toString

public java.lang.String toString()
Gets a formatted String representation of this ReaderResult.

Overrides:
toString in class java.lang.Object
Returns:
a formatted String representation of this ReaderResult.

setDate

public void setDate(ParsedDate date)

getAuthors

public ParsedAuthors getAuthors()
Gets the authors.

Returns:
the authors.

setAuthors

public void setAuthors(ParsedAuthors authors)

getTitle

public java.lang.String getTitle()
Gets the title.

Returns:
the title.

setTitle

public void setTitle(java.lang.String title)

getLocation

public java.lang.String getLocation()
Gets the location (e.g. the URL) of the document.

Returns:
the location (e.g. the URL) of the document.

setLocation

public void setLocation(java.lang.String location)

getLink

public java.lang.String getLink()
Gets an additional link provided by the document (if available).

Returns:
an additional link provided by the document (if available).

setLink

public void setLink(java.lang.String link)

getSource

public java.lang.String getSource()
Gets the source of the document (e.g. NY Times etc.).

Returns:
the source of the document (e.g. NY Times etc.).

setSource

public void setSource(java.lang.String source)

setContents

public void setContents(java.lang.String contents)

getContents

public java.lang.String getContents()
Gets the contents of the document.

Returns:
the contents of the document.

process

public ReaderResult.Error process(DocumentMetaData data,
                                  org.apache.uima.jcas.JCas cas)
Fills in the DocumentMetaData from the results using the specified cas.

Parameters:
data - the DocumentMetaData to fill in.
cas - the cas to use
Returns:
the error status of the result.

isValid

public ReaderResult.Error isValid()
Checks whether this ReaderResult is valid.

Returns:
the Error code. If the result is valid then Error.NONE will be returned, otherwise the Error code specifies where there error is.