Class ManualSplitGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
-
- adams.flow.transformer.indexedsplitsrunsgenerator.ManualSplitGenerator
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,OptionalRandomizable,QuickInfoSupporter,Randomizable,SizeOfHandler,FlowContextHandler,IndexedSplitsRunsGenerator,Serializable
public class ManualSplitGenerator extends AbstractIndexedSplitsRunsGenerator implements OptionalRandomizable
Uses the manually defined split ranges to generate the splits.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_Randomizewhether to randomize the data.protected longm_Seedthe seed value.protected BaseKeyValuePair[]m_Splitsthe named ranges.-
Fields inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
m_FlowContext, m_MetaData
-
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 ManualSplitGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]accepts()Returns the type of classes that are accepted as input.protected Stringcheck(Object data)Checks whether the data can be processed.voiddefineOptions()Adds options to the internal list of options.protected IndexedSplitsRunsdoGenerate(Object data, MessageCollection errors)Generates the indexed splits.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleangetRandomize()Returns whether to randomize the data.longgetSeed()Returns the seed value.BaseKeyValuePair[]getSplits()Returns the named split ranges.StringglobalInfo()Returns a string describing the object.StringrandomizeTipText()Returns the tip text for this property.StringseedTipText()Returns the tip text for this property.voidsetRandomize(boolean value)Sets whether to randomize the data.voidsetSeed(long value)Sets the seed value.voidsetSplits(BaseKeyValuePair[] value)Sets the named split ranges.StringsplitsTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.indexedsplitsrunsgenerator.AbstractIndexedSplitsRunsGenerator
generate, getFlowContext, getMetaData, metaDataTipText, postGenerate, setFlowContext, setMetaData
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, 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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Randomize
protected boolean m_Randomize
whether to randomize the data.
-
m_Seed
protected long m_Seed
the seed value.
-
m_Splits
protected BaseKeyValuePair[] m_Splits
the named ranges.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractIndexedSplitsRunsGenerator
-
setRandomize
public void setRandomize(boolean value)
Sets whether to randomize the data.- Specified by:
setRandomizein interfaceOptionalRandomizable- Parameters:
value- true if to randomize the data
-
getRandomize
public boolean getRandomize()
Returns whether to randomize the data.- Specified by:
getRandomizein interfaceOptionalRandomizable- Returns:
- true if to randomize the data
-
randomizeTipText
public String randomizeTipText()
Returns the tip text for this property.- Specified by:
randomizeTipTextin interfaceOptionalRandomizable- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeedin interfaceRandomizable- Parameters:
value- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeedin interfaceRandomizable- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipTextin interfaceRandomizable- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSplits
public void setSplits(BaseKeyValuePair[] value)
Sets the named split ranges.- Parameters:
value- the split ranges
-
getSplits
public BaseKeyValuePair[] getSplits()
Returns the named split ranges.- Returns:
- the split ranges
-
splitsTipText
public String splitsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractIndexedSplitsRunsGenerator- Returns:
- null if no info available, otherwise short string
-
accepts
public Class[] accepts()
Returns the type of classes that are accepted as input.- Specified by:
acceptsin interfaceIndexedSplitsRunsGenerator- Specified by:
acceptsin classAbstractIndexedSplitsRunsGenerator- Returns:
- the classes
-
check
protected String check(Object data)
Checks whether the data can be processed.- Overrides:
checkin classAbstractIndexedSplitsRunsGenerator- Parameters:
data- the data to check- Returns:
- null if checks passed, otherwise error message
-
doGenerate
protected IndexedSplitsRuns doGenerate(Object data, MessageCollection errors)
Generates the indexed splits.- Specified by:
doGeneratein classAbstractIndexedSplitsRunsGenerator- Parameters:
data- the data to use for generating the splitserrors- for storing any errors occurring during processing- Returns:
- the splits or null in case of error
-
-