Package adams.flow.transformer.splitfile
Class SplitByNumber
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,Stoppable,FileSplitter,FileSplitterWithBinarySupport,Serializable
public class SplitByNumber extends AbstractFileSplitterWithBinarySupport
Splits the file into a number of equally sized files.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-prefix <adams.core.io.PlaceholderFile> (property: prefix) The prefix for the generated files. default: ./split
-extension <java.lang.String> (property: extension) The file extension to use. default: .bin
-num-digits <int> (property: numDigits) The number of digits to use for the index of the generated files. default: 3 minimum: 1
-file-type <TEXT|BINARY> (property: fileType) Defines how to treat the file(s). default: TEXT
-buffer-size <int> (property: bufferSize) The size of byte-buffer used for reading the content. default: 1024 minimum: 1
-num-files <int> (property: numFiles) The number of files to generate. default: 1 minimum: 1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_NumFilesthe number of files.-
Fields inherited from class adams.flow.transformer.splitfile.AbstractFileSplitterWithBinarySupport
m_BufferSize, m_FileType
-
Fields inherited from class adams.flow.transformer.splitfile.AbstractFileSplitter
m_Extension, m_Generated, m_NumDigits, m_Prefix, 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 SplitByNumber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected voiddoSplitBinary(PlaceholderFile file)Performs the actual splitting of the file.protected voiddoSplitText(PlaceholderFile file)Performs the actual splitting of the file.intgetNumFiles()Returns the number of files.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.StringnumFilesTipText()Returns the tip text for this property.voidsetNumFiles(int value)Sets the number the files.-
Methods inherited from class adams.flow.transformer.splitfile.AbstractFileSplitterWithBinarySupport
bufferSizeTipText, doSplit, fileTypeTipText, getBufferSize, getFileType, setBufferSize, setFileType
-
Methods inherited from class adams.flow.transformer.splitfile.AbstractFileSplitter
check, extensionTipText, getExtension, getNumDigits, getPrefix, nextFile, numDigitsTipText, prefixTipText, reset, setExtension, setNumDigits, setPrefix, split, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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.Destroyable
destroy
-
Methods inherited from interface adams.flow.transformer.splitfile.FileSplitter
extensionTipText, getExtension, getNumDigits, getPrefix, numDigitsTipText, prefixTipText, setExtension, setNumDigits, setPrefix, split
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
-
-
-
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 classAbstractFileSplitterWithBinarySupport
-
setNumFiles
public void setNumFiles(int value)
Sets the number the files.- Parameters:
value- the number
-
getNumFiles
public int getNumFiles()
Returns the number of files.- Returns:
- the number
-
numFilesTipText
public String numFilesTipText()
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 object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractFileSplitterWithBinarySupport- Returns:
- null if no info available, otherwise short string
-
doSplitText
protected void doSplitText(PlaceholderFile file)
Performs the actual splitting of the file.- Specified by:
doSplitTextin classAbstractFileSplitterWithBinarySupport- Parameters:
file- the file to split
-
doSplitBinary
protected void doSplitBinary(PlaceholderFile file)
Performs the actual splitting of the file.- Specified by:
doSplitBinaryin classAbstractFileSplitterWithBinarySupport- Parameters:
file- the file to split
-
-