public class SimilarUnitPairsFile extends MergeableSimilarUnitPairsFile
UnitPair
class.
That means it contains pairs {first, second}, where first, second are identificators of units
on which we check duplicity (can be document, paragraph or sentence).
The file is sorted - the main criteria is first field, in case of tie second field. SimilarUnitPairsFileProducer
or read from the filesystem.merge(org.egothor.duplicity.file.SimilarUnitPairsFile, org.egothor.duplicity.file.SimilarUnitPairsTempFile)
method.Constructor and Description |
---|
SimilarUnitPairsFile(long permID,
String location)
Initialializes the file already written to filesystem.
|
Modifier and Type | Method and Description |
---|---|
String |
getFilename()
Returns the filename corresponding to this file.
|
void |
merge(CommonSimilarUnitPairsFile supf)
Merges two files externally, on filesystem.
|
void |
merge(SimilarUnitPairsFile supfr,
SimilarUnitPairsTempFile supft)
Merges three files externally, on filesystem.
|
dump, getPermID, hasTheSameContent, remove, toString
delete, getLocation, getOut, hasTheSameContent
public SimilarUnitPairsFile(long permID, String location) throws FileNotFoundException
getFilename()
and will be searched in the location directory.permID
- identification of the permutation to be assigned to this filelocation
- path and name of the directory in which the file will be searched,
must end with "/" signFileNotFoundException
- if the file does not existpublic void merge(SimilarUnitPairsFile supfr, SimilarUnitPairsTempFile supft) throws IOException, MergeException
supfr
- regular file to be merged into this
(SimilarUnitPairsFile
)supft
- temporary file to be merged into this
(SimilarUnitPairsTempFile
)MergeException
- on attempt to merge files corresponding to different permutations
or if temporary file could not be createdIOException
public void merge(CommonSimilarUnitPairsFile supf) throws IOException, MergeException
supf
- file to be merged into this. Can be regular
(SimilarUnitPairsFile
)
or temporary (SimilarUnitPairsTempFile
).MergeException
- on attempt to merge files corresponding to different permutations
or if temporary file could not be createdIOException
public String getFilename()
Constants.SIMILAR_UNIT_PAIRS_FILE_PREFIX
<permID>.getFilename
in class DuplicityCheckingFile
Copyright © 2016 Egothor. All Rights Reserved.