adams.data.conversion
Class AbstractMatchWekaInstanceAgainstHeader

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.conversion.AbstractConversion
              extended by adams.data.conversion.AbstractMatchWekaInstanceAgainstHeader
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, ShallowCopySupporter<AbstractConversion>, SizeOfHandler, 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: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  weka.core.Instances m_Dataset
          the header to match against.
 
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
AbstractMatchWekaInstanceAgainstHeader()
           
 
Method Summary
 Class accepts()
          Returns the class that is accepted as input.
protected  Object doConvert()
          Performs the actual conversion.
 Class generates()
          Returns the class that is generated as output.
protected abstract  weka.core.Instances getDatasetHeader()
          Acquires the dataset header.
protected  String isCompatible(weka.core.Instance input)
          Checks the instance against the header, whether they are compatible.
protected  weka.core.Instance match(weka.core.Instance input)
          Matches the input instance against the header.
protected  void reset()
          Resets the converter.
 
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getInput, getOutput, getOwner, setInput, setOwner, shallowCopy, shallowCopy
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Dataset

protected weka.core.Instances m_Dataset
the header to match against.

Constructor Detail

AbstractMatchWekaInstanceAgainstHeader

public AbstractMatchWekaInstanceAgainstHeader()
Method Detail

reset

protected void reset()
Resets the converter.

Overrides:
reset in class AbstractConversion

accepts

public Class accepts()
Returns the class that is accepted as input.

Specified by:
accepts in interface Conversion
Specified by:
accepts in class AbstractConversion
Returns:
the class

generates

public Class generates()
Returns the class that is generated as output.

Specified by:
generates in interface Conversion
Specified by:
generates in class AbstractConversion
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:
doConvert in class AbstractConversion
Returns:
the converted data
Throws:
Exception - if something goes wrong with the conversion


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.