de.hpi.fgis.dude.preprocessor
Class CountPreprocessor

java.lang.Object
  extended by de.hpi.fgis.dude.preprocessor.CountPreprocessor
All Implemented Interfaces:
Preprocessor

public class CountPreprocessor
extends Object
implements Preprocessor

CountPreprocessor is a sample class, that shows how the Preprocessor interface can be used. Since analyzeDuDeObject(DuDeObject) is called once for each extracted DuDeObject we can gather statistics within the extraction phase. This sample class implements an object count. It simply counts the analyzeDuDeObject(DuDeObject) calls. The object count can be used later on by calling getObjectCount().

Author:
Matthias Pohl

Constructor Summary
CountPreprocessor()
          Initializes a CountPreprocessor.
 
Method Summary
 void analyzeDuDeObject(DuDeObject data)
          Passes the currently extracted DuDeObject to the Preprocessor for further analysis.
 void clearData()
          Clears statistics that were already gathered.
 void finish()
          This method is called after finishing the data extraction process.
 int getObjectCount()
          Returns the number of objects that were extracted during the data extraction phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountPreprocessor

public CountPreprocessor()
Initializes a CountPreprocessor.

Method Detail

analyzeDuDeObject

public void analyzeDuDeObject(DuDeObject data)
Description copied from interface: Preprocessor
Passes the currently extracted DuDeObject to the Preprocessor for further analysis. This method is called by every DataSource per extracted data record.

Specified by:
analyzeDuDeObject in interface Preprocessor
Parameters:
data - The DuDeObject that shall be analyzed.

getObjectCount

public int getObjectCount()
Returns the number of objects that were extracted during the data extraction phase.

Returns:
The number of extracted DuDeObjects.

clearData

public void clearData()
Description copied from interface: Preprocessor
Clears statistics that were already gathered.

Specified by:
clearData in interface Preprocessor

finish

public void finish()
Description copied from interface: Preprocessor
This method is called after finishing the data extraction process. It can be used in order to created some further statistics.

Specified by:
finish in interface Preprocessor


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.