org.egothor.core
Class DocumentData

java.lang.Object
  extended by org.egothor.core.DocumentData
All Implemented Interfaces:
java.lang.Cloneable

public final class DocumentData
extends java.lang.Object
implements java.lang.Cloneable

The DocumentData object is the root of all document metadata objects. This class is not synchronized.

Author:
Leo Galambos

Constructor Summary
DocumentData(DocumentData old)
          Construct a new DocumentData object using the Hashtable of the given DocumentData object.
DocumentData(long uid)
          Constructor for the DocumentData object.
DocumentData(long uid, int docDBRevision)
           
DocumentData(long uid, long revision)
           
 
Method Summary
 java.lang.Object clone()
           
 void computeMins(PermutatedMinsFiller permutatedMinsFiller)
           
 java.lang.String convertData2String()
           
 java.lang.String convertData2String(java.lang.String encoding)
           
 java.lang.String getContentType()
           
 byte[] getData()
           
 int getDataLen()
           
 long getDateTime()
           
 int getDocDBRevision()
           
 DocumentPermutatedMins getDocumentMins()
           
 DocumentUnitID getDocumentUnitID()
          Get DocumentUnitID object representing this DocumentData.
 java.lang.String getLocation()
           
 java.lang.String getOriginalContentType()
           
 int getRevision()
           
 java.lang.String getTitle()
           
 long getUID()
           
 boolean isResolved()
           
 void load(DataInput dis)
          Read this object into the given input stream.
 void printCached(java.io.Writer out, java.lang.String cached_msg, java.lang.String sorry_msg)
           
 void releaseDocumentMins()
           
 void setCheckDuplicity(boolean checkDuplicity)
           
 void setContentType(java.lang.String contentType)
           
 void setData(java.lang.String contentType, byte[] data)
           
 void setData(java.lang.String contentType, byte[] data, int data_len)
           
 void setData(java.lang.String contentType, java.lang.String data, java.lang.String encoding)
           
 void setDateTime(long dateTime)
           
 void setDocDBRevision(int docDBRevision)
           
 void setDocumentMins(DocumentPermutatedMins documentMins)
           
 void setFakeData(java.lang.String contentType, java.lang.String data, java.lang.String encoding)
          Sets a new content, but does not change the length of the original data block.
 void setLocation(java.lang.String location)
           
 void setOriginalContentType(java.lang.String originalContentType)
           
 void setRevision(int revision)
           
 void setTitle(java.lang.String title)
           
 void setUID(long uid)
           
 void store(DataOutput dos)
          Write this object to the given output stream.
 java.lang.String toString()
          Construct a String representation of this HTMLMetadata object.
 Sequence<Token> words(boolean readlinx, boolean readilinx, boolean lowercase, boolean phonetics, HTMLField.Diacritics diacritics, boolean paragraphs, boolean paragraphsKeepPunctuation, java.lang.String encoding)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentData

public DocumentData(long uid)
Constructor for the DocumentData object.


DocumentData

public DocumentData(long uid,
                    int docDBRevision)

DocumentData

public DocumentData(long uid,
                    long revision)

DocumentData

public DocumentData(DocumentData old)
Construct a new DocumentData object using the Hashtable of the given DocumentData object.

Parameters:
old - the DocumentData object containing the metadata for the new object
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

printCached

public void printCached(java.io.Writer out,
                        java.lang.String cached_msg,
                        java.lang.String sorry_msg)
                 throws java.io.IOException,
                        java.net.URISyntaxException
Throws:
java.io.IOException
java.net.URISyntaxException

toString

public java.lang.String toString()
Construct a String representation of this HTMLMetadata object.

Overrides:
toString in class java.lang.Object
Returns:
This implementation returns a string that looks like this: Title [Location] :Summary

convertData2String

public java.lang.String convertData2String(java.lang.String encoding)
                                    throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

convertData2String

public final java.lang.String convertData2String()

store

public void store(DataOutput dos)
           throws java.io.IOException
Write this object to the given output stream.

Parameters:
dos - the output stream
Throws:
java.io.IOException - Description of the Exception

load

public void load(DataInput dis)
          throws java.io.IOException
Read this object into the given input stream.

Parameters:
dis - the input stream
Throws:
java.io.IOException - Description of the Exception

isResolved

public boolean isResolved()

getUID

public long getUID()

setUID

public void setUID(long uid)

getData

public byte[] getData()

getDataLen

public int getDataLen()

setData

public void setData(java.lang.String contentType,
                    byte[] data,
                    int data_len)

setData

public final void setData(java.lang.String contentType,
                          byte[] data)

getLocation

public java.lang.String getLocation()

setLocation

public void setLocation(java.lang.String location)

setContentType

public void setContentType(java.lang.String contentType)

setData

public void setData(java.lang.String contentType,
                    java.lang.String data,
                    java.lang.String encoding)
             throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

setFakeData

public void setFakeData(java.lang.String contentType,
                        java.lang.String data,
                        java.lang.String encoding)
                 throws java.io.UnsupportedEncodingException
Sets a new content, but does not change the length of the original data block. This method is used when the content of this document should be replaced with some snippet replacing the full text.

Throws:
java.io.UnsupportedEncodingException

getContentType

public java.lang.String getContentType()

getDateTime

public long getDateTime()

setDateTime

public void setDateTime(long dateTime)

setTitle

public void setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

getOriginalContentType

public java.lang.String getOriginalContentType()

setOriginalContentType

public void setOriginalContentType(java.lang.String originalContentType)

getRevision

public int getRevision()

setRevision

public void setRevision(int revision)

getDocDBRevision

public int getDocDBRevision()

setDocDBRevision

public void setDocDBRevision(int docDBRevision)

getDocumentMins

public DocumentPermutatedMins getDocumentMins()

setDocumentMins

public void setDocumentMins(DocumentPermutatedMins documentMins)

releaseDocumentMins

public void releaseDocumentMins()

setCheckDuplicity

public void setCheckDuplicity(boolean checkDuplicity)

words

public Sequence<Token> words(boolean readlinx,
                             boolean readilinx,
                             boolean lowercase,
                             boolean phonetics,
                             HTMLField.Diacritics diacritics,
                             boolean paragraphs,
                             boolean paragraphsKeepPunctuation,
                             java.lang.String encoding)
                      throws DuplicityCheckingException
Throws:
DuplicityCheckingException

computeMins

public void computeMins(PermutatedMinsFiller permutatedMinsFiller)
                 throws DuplicityCheckingException
Throws:
DuplicityCheckingException

getDocumentUnitID

public DocumentUnitID getDocumentUnitID()
Get DocumentUnitID object representing this DocumentData.

Returns:
DocumentUnitID