adams.data.conversion
Class SpreadSheetSplitColumn

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.AbstractSpreadSheetConversion
                  extended by adams.data.conversion.SpreadSheetSplitColumn
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<AbstractConversion>, SizeOfHandler, Stoppable, Conversion, Serializable

public class SpreadSheetSplitColumn
extends AbstractSpreadSheetConversion

Splits the string representation of the cells of a column into multiple columns using a regular expression.

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to 
    the console (0 = off).
    default: 0
    minimum: 0
 
-column <adams.core.Index> (property: column)
    The column to split.
    default: first
 
-expression <java.lang.String> (property: expression)
    The regular expression used for splitting the column; \t\n\r\b\f get automatically 
    converted into their character counterparts.
    default: \\t
 
-delimiter <DISCARD|APPEND|PREPEND> (property: delimiter)
    Defines what to do with the delimiters (= expression).
    default: DISCARD
 

Version:
$Revision: 6866 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  SpreadSheetColumnIndex m_Column
          the column to process.
protected  StringSplit.Delimiter m_Delimiter
          what to do with the delimiters.
protected  BaseRegExp m_Expression
          the regular expression to use for splitting the string.
 
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner, m_Stopped
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
SpreadSheetSplitColumn()
           
 
Method Summary
 String columnTipText()
          Returns the tip text for this property.
protected  SpreadSheet convert(SpreadSheet input)
          Returns a string describing the object.
 void defineOptions()
          Adds options to the internal list of options.
 String delimiterTipText()
          Returns the tip text for this property.
 String expressionTipText()
          Returns the tip text for this property.
 SpreadSheetColumnIndex getColumn()
          Returns the column to split.
 StringSplit.Delimiter getDelimiter()
          Returns what to do with the delimiter (= expression).
 BaseRegExp getExpression()
          Returns the regular expression for splitting the string.
 String getQuickInfo()
          Returns a quick info about the actor, which will be displayed in the GUI.
 String globalInfo()
          Returns a string describing the object.
 void setColumn(SpreadSheetColumnIndex value)
          Sets the column to split.
 void setDelimiter(StringSplit.Delimiter value)
          Sets what to do with the delimiter (= expression).
 void setExpression(BaseRegExp value)
          Sets the regular expression used for splitting the string.
 
Methods inherited from class adams.data.conversion.AbstractSpreadSheetConversion
accepts, doConvert, generates
 
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getInput, getOutput, getOwner, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, destroy, finishInit, getDebugLevel, getOptionManager, 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_Column

protected SpreadSheetColumnIndex m_Column
the column to process.


m_Expression

protected BaseRegExp m_Expression
the regular expression to use for splitting the string.


m_Delimiter

protected StringSplit.Delimiter m_Delimiter
what to do with the delimiters.

Constructor Detail

SpreadSheetSplitColumn

public SpreadSheetSplitColumn()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
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 interface OptionHandler
Overrides:
defineOptions in class AbstractOptionHandler

getQuickInfo

public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.

Specified by:
getQuickInfo in interface QuickInfoSupporter
Overrides:
getQuickInfo in class AbstractConversion
Returns:
null if no info available, otherwise short string

setColumn

public void setColumn(SpreadSheetColumnIndex value)
Sets the column to split.

Parameters:
value - the index

getColumn

public SpreadSheetColumnIndex getColumn()
Returns the column to split.

Returns:
the index

columnTipText

public String columnTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setExpression

public void setExpression(BaseRegExp value)
Sets the regular expression used for splitting the string.

Parameters:
value - the expression

getExpression

public BaseRegExp getExpression()
Returns the regular expression for splitting the string.

Returns:
the expression

expressionTipText

public String expressionTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setDelimiter

public void setDelimiter(StringSplit.Delimiter value)
Sets what to do with the delimiter (= expression).

Parameters:
value - the action

getDelimiter

public StringSplit.Delimiter getDelimiter()
Returns what to do with the delimiter (= expression).

Returns:
the action

delimiterTipText

public String delimiterTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

convert

protected SpreadSheet convert(SpreadSheet input)
                       throws Exception
Returns a string describing the object.

Specified by:
convert in class AbstractSpreadSheetConversion
Parameters:
input - the incoming spreadsheet
Returns:
a description suitable for displaying in the gui
Throws:
Exception - if conversion fails for some reason


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