Package adams.flow.transformer.splitfile
Class SplitByLineCount
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.splitfile.AbstractFileSplitter
-
- adams.flow.transformer.splitfile.SplitByLineCount
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Stoppable,Serializable
public class SplitByLineCount extends AbstractFileSplitter
Splits the text file into chunks with the specified maximum of lines.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-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
-max-lines <int> (property: maxLines) The maximum number of lines in the generated files. default: 1024 minimum: 1
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_MaxLinesthe maximum number of lines.-
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 SplitByLineCount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected voiddoSplit(PlaceholderFile file)Performs the actual splitting of the file.intgetMaxLines()Returns the maximum number of lines for the files.StringglobalInfo()Returns a string describing the object.StringmaxLinesTipText()Returns the tip text for this property.voidsetMaxLines(int value)Sets the maximum number of lines for the files.-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
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 classAbstractFileSplitter
-
setMaxLines
public void setMaxLines(int value)
Sets the maximum number of lines for the files.- Parameters:
value- the maximum lines
-
getMaxLines
public int getMaxLines()
Returns the maximum number of lines for the files.- Returns:
- the maximum lines
-
maxLinesTipText
public String maxLinesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doSplit
protected void doSplit(PlaceholderFile file)
Performs the actual splitting of the file.- Specified by:
doSplitin classAbstractFileSplitter- Parameters:
file- the file to split
-
-