Package adams.data.conversion
Class AbstractMatchWekaInstanceAgainstHeader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.AbstractMatchWekaInstanceAgainstHeader
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<AbstractConversion>,SizeOfHandler,Stoppable,Conversion,Serializable
- Direct Known Subclasses:
MatchWekaInstanceAgainstFileHeader,MatchWekaInstanceAgainstStorageHeader
public abstract class AbstractMatchWekaInstanceAgainstHeader extends AbstractConversion
Ancestor for classes that match Instance objects against Instances headers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected weka.core.Instancesm_Datasetthe header to match against.-
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractMatchWekaInstanceAgainstHeader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Classaccepts()Returns the class that is accepted as input.protected ObjectdoConvert()Performs the actual conversion.Classgenerates()Returns the class that is generated as output.protected abstract weka.core.InstancesgetDatasetHeader()Acquires the dataset header.protected StringisCompatible(weka.core.Instance input)Checks the instance against the header, whether they are compatible.protected weka.core.Instancematch(weka.core.Instance input)Matches the input instance against the header.protected voidreset()Resets the converter.-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, getQuickInfo, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
reset
protected void reset()
Resets the converter.- Overrides:
resetin classAbstractConversion
-
accepts
public Class accepts()
Returns the class that is accepted as input.- Specified by:
acceptsin interfaceConversion- Specified by:
acceptsin classAbstractConversion- Returns:
- the class
-
generates
public Class generates()
Returns the class that is generated as output.- Specified by:
generatesin interfaceConversion- Specified by:
generatesin classAbstractConversion- Returns:
- the class
-
getDatasetHeader
protected abstract weka.core.Instances getDatasetHeader()
Acquires the dataset header.- Returns:
- the dataset header to match against
-
isCompatible
protected String isCompatible(weka.core.Instance input)
Checks the instance against the header, whether they are compatible.- Parameters:
input- the input instance- Returns:
- null if compatible, otherwise error message
-
match
protected weka.core.Instance match(weka.core.Instance input)
Matches the input instance against the header.- Parameters:
input- the Instance to align to the header- Returns:
- the aligned Instance
-
doConvert
protected Object doConvert() throws Exception
Performs the actual conversion.- Specified by:
doConvertin classAbstractConversion- Returns:
- the converted data
- Throws:
Exception- if something goes wrong with the conversion
-
-