org.egothor.duplicity.datastructure
Class DocumentUnitID

java.lang.Object
  extended by org.egothor.duplicity.datastructure.TextUnitID
      extended by org.egothor.duplicity.datastructure.DocumentUnitID
All Implemented Interfaces:
java.lang.Comparable

public class DocumentUnitID
extends TextUnitID

Class represents a unit of text on document 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 DocumentUnitIDPool so that only one instance of DocumentUnitID exists for each document.

Author:
Kate�ina Dufkov�

Field Summary
 
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 DocumentUnitID getInstance(long documentUID, int documentDBRevision)
          This is the recommended way to create an instance.
 int hashCode()
           
static DocumentUnitID 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
 

Method Detail

getInstance

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

Parameters:
documentUID -
documentDBRevision -

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 DocumentUnitID load(DataInputStream dis)
                           throws java.io.IOException
Throws:
java.io.IOException