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 boolean
m_Randomize
whether to randomize the data.protected long
m_Seed
the seed value.protected BaseKeyValuePair[]
m_Splits
the 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 String
check(Object data)
Checks whether the data can be processed.void
defineOptions()
Adds options to the internal list of options.protected IndexedSplitsRuns
doGenerate(Object data, MessageCollection errors)
Generates the indexed splits.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
getRandomize()
Returns whether to randomize the data.long
getSeed()
Returns the seed value.BaseKeyValuePair[]
getSplits()
Returns the named split ranges.String
globalInfo()
Returns a string describing the object.String
randomizeTipText()
Returns the tip text for this property.String
seedTipText()
Returns the tip text for this property.void
setRandomize(boolean value)
Sets whether to randomize the data.void
setSeed(long value)
Sets the seed value.void
setSplits(BaseKeyValuePair[] value)
Sets the named split ranges.String
splitsTipText()
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractIndexedSplitsRunsGenerator
-
setRandomize
public void setRandomize(boolean value)
Sets whether to randomize the data.- Specified by:
setRandomize
in interfaceOptionalRandomizable
- Parameters:
value
- true if to randomize the data
-
getRandomize
public boolean getRandomize()
Returns whether to randomize the data.- Specified by:
getRandomize
in interfaceOptionalRandomizable
- Returns:
- true if to randomize the data
-
randomizeTipText
public String randomizeTipText()
Returns the tip text for this property.- Specified by:
randomizeTipText
in 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:
setSeed
in interfaceRandomizable
- Parameters:
value
- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeed
in interfaceRandomizable
- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipText
in 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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in 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:
accepts
in interfaceIndexedSplitsRunsGenerator
- Specified by:
accepts
in classAbstractIndexedSplitsRunsGenerator
- Returns:
- the classes
-
check
protected String check(Object data)
Checks whether the data can be processed.- Overrides:
check
in 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:
doGenerate
in 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
-
-