|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.AbstractCleanable de.hpi.fgis.dude.algorithm.AbstractAlgorithm de.hpi.fgis.dude.algorithm.AbstractRecordLinkage
public abstract class AbstractRecordLinkage
AbstractRecordLinkage
provides the common functionality that is needed by every record-linkage algorithm. Any new record-linkage
algorithm implementation should extend this class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.hpi.fgis.dude.algorithm.AbstractAlgorithm |
---|
AbstractAlgorithm.AlgorithmIteratorWrapper |
Constructor Summary | |
---|---|
AbstractRecordLinkage()
|
Method Summary | |
---|---|
protected void |
addSource(DataSource source)
Adds the DataSource to this instance. |
protected abstract Iterator<DuDeObjectPair> |
createIteratorInstance()
Returns a new Iterator instance. |
protected boolean |
dataSourceAttached(DataSource source)
Checks whether the passed DataSource is attached to this AbstractAlgorithm instance. |
boolean |
equals(Object obj)
|
void |
fromJson(DuDeJsonParser<?> jsonParser)
Initializes the current instance using the passed DuDeJsonParser . |
protected Iterable<Map.Entry<DataSource,DuDeStorage<DuDeObject>>> |
getData()
Returns the DataSource s and their extracted data. |
protected JsonableReader<DuDeObject> |
getData(DataSource source)
Returns a JsonableReader that can be used to return the extracted data of the passed DataSource . |
int |
getDataSize()
Returns the overall data size after the extraction process is finished. |
long |
getMaximumPairCount()
Returns the number of pairs, that would be generated by the naive algorithm of the current instance's algorithm type based on the extracted data size. |
int |
hashCode()
|
Iterator<DuDeObjectPair> |
iterator()
Starts the extraction and preprocessing phase if necessary and returns an Iterator instance for iterating over the algorithm's result. |
protected Map<DataSource,DuDeStorage<DuDeObject>> |
preprocessData(Iterable<DataSource> dataSources)
Preprocesses the data. |
void |
toJson(DuDeJsonGenerator jsonGenerator)
Generates the Json code using the passed DuDeJsonGenerator . |
void |
unregisterDataSources()
Unregisters all DataSource s. |
Methods inherited from class de.hpi.fgis.dude.algorithm.AbstractAlgorithm |
---|
addDataSource, addPreprocessor, addPreprocessor, analyzeDuDeObject, createStorage, dataExtracted, disableInMemoryProcessing, enableInMemoryProcessing, finishExtraction, finishPreprocessing, forceExtraction, getDataSize, getExtractedData, inMemoryProcessingEnabled |
Methods inherited from class de.hpi.fgis.dude.util.AbstractCleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.hpi.fgis.dude.util.Cleanable |
---|
cleanUp, registerCleanable, registerCloseable |
Constructor Detail |
---|
public AbstractRecordLinkage()
Method Detail |
---|
public void fromJson(DuDeJsonParser<?> jsonParser) throws org.codehaus.jackson.JsonParseException, IOException
Jsonable
DuDeJsonParser
.
fromJson
in interface Jsonable
jsonParser
- The parser that is used for extracting the data out of the Json.
org.codehaus.jackson.JsonParseException
- If an error occurs while parsing the Json.
IOException
- If an error occurs while reading from the stream.public void toJson(DuDeJsonGenerator jsonGenerator) throws org.codehaus.jackson.JsonGenerationException, IOException
Jsonable
DuDeJsonGenerator
.
toJson
in interface Jsonable
jsonGenerator
- The DuDeJsonGenerator
that is used internally.
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while writing to the output.public void unregisterDataSources()
Algorithm
DataSource
s.
unregisterDataSources
in interface Algorithm
protected void addSource(DataSource source)
AbstractAlgorithm
DataSource
to this instance.
addSource
in class AbstractAlgorithm
source
- The DataSource
that shall be added.protected boolean dataSourceAttached(DataSource source)
AbstractAlgorithm
DataSource
is attached to this AbstractAlgorithm
instance.
dataSourceAttached
in class AbstractAlgorithm
source
- The DataSource
that shall be checked.
true
, if the passed DataSource
was added to this instance; false
otherwise or null
was passed.public int getDataSize()
Algorithm
getDataSize
in interface Algorithm
getDataSize
in class AbstractAlgorithm
DuDeObject
s or 0
, if the data was not extracted, yet.public Iterator<DuDeObjectPair> iterator()
AbstractAlgorithm
Iterator
instance for iterating over the algorithm's result.
iterator
in interface Iterable<DuDeObjectPair>
iterator
in class AbstractAlgorithm
protected JsonableReader<DuDeObject> getData(DataSource source)
JsonableReader
that can be used to return the extracted data of the passed DataSource
.
source
- The DataSource
of which the data is requested.
JsonableReader
or null
, if this DataSource
was not added.
NullPointerException
- If null
was passed as a DataSource
.protected Iterable<Map.Entry<DataSource,DuDeStorage<DuDeObject>>> getData()
DataSource
s and their extracted data.
DataSources
and their extracted data.protected abstract Iterator<DuDeObjectPair> createIteratorInstance()
Iterator
instance.
Iterator
instance.protected Map<DataSource,DuDeStorage<DuDeObject>> preprocessData(Iterable<DataSource> dataSources)
dataSources
- The data sources of which the data shall be preprocessed.
null
, if the preprocessing shall be ignored.public long getMaximumPairCount()
Algorithm
0
will be returned.
getMaximumPairCount
in interface Algorithm
0
, if the data
wasn't extracted, yet.public int hashCode()
hashCode
in class AbstractAlgorithm
public boolean equals(Object obj)
equals
in class AbstractAlgorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |