org.egothor.duplicity.datastructure
Class ParagraphUnitID

java.lang.Object
  extended by org.egothor.duplicity.datastructure.TextUnitID
      extended by org.egothor.duplicity.datastructure.ParagraphUnitID
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
SentenceUnitID

public class ParagraphUnitID
extends TextUnitID

Class represents a unit of text on paragraph duplicity checking level (see Constants.CHECK_DUPLICITY_LEVEL). This class is *IMMUTABLE*, which means that each time a method that is supposed to change something is called, another instance is returned. The objects of this type are pooled using ParagraphUnitIDPool so that only one instance of ParagraphUnitID exists for each document.

Author:
Kate�ina Dufkov�

Field Summary
protected  short paragraph
          Ordinal number of the paragraph, the same as Token.paragraph field.
 
Fields inherited from class org.egothor.duplicity.datastructure.TextUnitID
documentDBRevision, documentUID, GENERAL_SEP, REVISION_SEP
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object obj)
           
static ParagraphUnitID getInstance(long documentUID, int documentDBRevision, short paragraph)
          This is the recommended way to create an instance.
 short getParagraph()
           
 int hashCode()
           
static ParagraphUnitID load(DataInputStream dis)
           
 void store(DataOutputStream dos)
           
 java.lang.String toNiceMeString()
          Returns textual representation of the unit to be printed in duplicity checking reports.
 java.lang.String toNiceOtherString()
          Returns textual representation of the unit to be printed in duplicity checking reports.
 java.lang.String toString()
           
 
Methods inherited from class org.egothor.duplicity.datastructure.TextUnitID
getDocumentDBRevision, getDocumentUID, getInstance, releasePools
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

paragraph

protected final short paragraph
Ordinal number of the paragraph, the same as Token.paragraph field.

Method Detail

getInstance

public static ParagraphUnitID getInstance(long documentUID,
                                          int documentDBRevision,
                                          short paragraph)
This is the recommended way to create an instance.

Parameters:
documentUID -
documentDBRevision -
paragraph -

getParagraph

public short getParagraph()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toNiceMeString

public java.lang.String toNiceMeString()
Returns textual representation of the unit to be printed in duplicity checking reports. This is used for identifying units in the examined document and should not contain document id.

Specified by:
toNiceMeString in class TextUnitID
Returns:
string representation of the object

toNiceOtherString

public java.lang.String toNiceOtherString()
Returns textual representation of the unit to be printed in duplicity checking reports. This is used for identifying units in the already indexed documents and should contain document id.

Specified by:
toNiceOtherString in class TextUnitID
Returns:
string representation of the object

compareTo

public int compareTo(java.lang.Object obj)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

store

public void store(DataOutputStream dos)
           throws java.io.IOException
Specified by:
store in class TextUnitID
Throws:
java.io.IOException

load

public static ParagraphUnitID load(DataInputStream dis)
                            throws java.io.IOException
Throws:
java.io.IOException