org.egothor.duplicity.file
Class CommonSimilarUnitPairsFile

java.lang.Object
  extended by org.egothor.duplicity.file.DuplicityCheckingFile
      extended by org.egothor.duplicity.file.CommonSimilarUnitPairsFile
Direct Known Subclasses:
MergeableSimilarUnitPairsFile, SimilarUnitPairsTempFile

public abstract class CommonSimilarUnitPairsFile
extends DuplicityCheckingFile

Common features of SimilarUnitPairsFile, AllSimilarUnitPairsFile and SimilarUnitPairsTempFile. All classes represent the "similar unit pairs" file used in duplicity checking algorithm.

Author:
Kate�ina Dufkov�

Nested Class Summary
 
Nested classes/interfaces inherited from class org.egothor.duplicity.file.DuplicityCheckingFile
DuplicityCheckingFile.TempFile
 
Field Summary
protected  long permID
          The identificator of permutation to which the file belongs.
 
Fields inherited from class org.egothor.duplicity.file.DuplicityCheckingFile
location, out
 
Constructor Summary
protected CommonSimilarUnitPairsFile()
           
 
Method Summary
 java.lang.String dump()
          Dumps the file with its content to String.
 long getPermID()
           
 boolean hasTheSameContent(DuplicityCheckingFile file)
          Checks if two files has the same content.
 void remove(java.util.Set<DocumentUnitID> toRemove)
          Removes all occurences of documents given in the set from the file.
 java.lang.String toString()
           
 
Methods inherited from class org.egothor.duplicity.file.DuplicityCheckingFile
createOut, createPermOut, createTempOut, delete, dump, getFilename, getLocation, getNewTempFile, getOut, hasTheSameContent, initFromProducer, openOut, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permID

protected long permID
The identificator of permutation to which the file belongs.

Constructor Detail

CommonSimilarUnitPairsFile

protected CommonSimilarUnitPairsFile()
Method Detail

toString

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

dump

public java.lang.String dump()
Dumps the file with its content to String.

Returns:
String representation of the file with its content

hasTheSameContent

public boolean hasTheSameContent(DuplicityCheckingFile file)
Checks if two files has the same content.

Parameters:
file - the second file to be tested
Returns:
true, if the file contents are the same

remove

public void remove(java.util.Set<DocumentUnitID> toRemove)
            throws java.io.IOException
Removes all occurences of documents given in the set from the file.

Parameters:
toRemove - set of document ids to remove
Throws:
java.io.IOException

getPermID

public long getPermID()