Class PermutatedMinsFileProducer

  extended by org.egothor.duplicity.file.PermutatedMinsFileProducer

public class PermutatedMinsFileProducer
extends java.lang.Object

Represents the "minimums of permutated unit identificators" file used in duplicity checking algorithm, before if was written to the filesystem. Allows producing new instances of PermutatedMinsFile class. The file contains instances of UnitPermutatedMin class. That means it contains pairs {min(pi(T(d))), d}, where:

The class should be used as follows.
  1. The class must be constructed by its constructor.
  2. Barrels can be added by a call to add(org.egothor.core.DocumentData).
  3. Committing barrels by a call to commit(java.lang.String) sorts and writes data to filesystem and returns instance of PermutatedMinsFile class.

Kate�ina Dufkov�

Constructor Summary
PermutatedMinsFileProducer(long permID)
          Initializes the object.
Method Summary
 void add(DocumentData doc)
          Adds document to the file.
 PermutatedMinsFile commit(java.lang.String location)
          Commit the changes in the buffer to the main file.
 java.util.List<UnitPermutatedMin> getBuffer()
 long getPermID()
 java.lang.String toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public PermutatedMinsFileProducer(long permID)
Initializes the object.

permID - permutation assigned to this file
Method Detail


public java.util.List<UnitPermutatedMin> getBuffer()


public long getPermID()


public void add(DocumentData doc)
Adds document to the file. It takes the duplicityMins of the DocumentData object, and appends every field of the map that corresponds to our permutation to its content to the internal buffer. The appended fields are then released from the DocumentPermutatedMins field of DocumentData object.

doc - document to be added


public PermutatedMinsFile commit(java.lang.String location)
Commit the changes in the buffer to the main file.


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