Package adams.data.twitter
Class TextConverter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.twitter.AbstractTwitterStatusConverter<String>
-
- adams.data.twitter.TextConverter
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.QuickInfoSupporter
,adams.core.SizeOfHandler
,Serializable
public class TextConverter extends AbstractTwitterStatusConverter<String>
A simple text converter.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-field <ID|USER_ID|USER_NAME|SOURCE|TEXT|CREATED|FAVORITED|RETWEET|RETWEET_COUNT|RETWEET_BY_ME|POSSIBLY_SENSITIVE|GEO_LATITUDE|GEO_LONGITUDE|LANGUAGE_CODE|PLACE|PLACE_TYPE|PLACE_URL|STREET_ADDRESS|COUNTRY|COUNTRY_CODE> [-field ...] (property: fields) The fields to use for generating the output. default: TEXT
-separator <java.lang.String> (property: separator) The separator to use when generating strings as output; tab, new line, carriage return and backslash need to be escaped, ie, ' ', ' ', ' ', '\'. default: \t
-quote <boolean> (property: quote) If enabled all sub-strings are quoted if necessary when generating string output. default: false
-date-format <adams.data.DateFormatString> (property: dateFormat) The format for the dates. default: yyyy-MM-dd HH:mm:ss more: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.DateFormatString
m_DateFormat
for format for dates.protected boolean
m_Quote
whether to quote strings.protected String
m_Separator
the separator, when generating a string.-
Fields inherited from class adams.data.twitter.AbstractTwitterStatusConverter
m_Fields
-
-
Constructor Summary
Constructors Constructor Description TextConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
dateFormatTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected String
doConvert(Hashtable<TwitterField,Object> fields)
Performs the actual conversion.Class
generates()
Returns the class of the output data that is generated.adams.data.DateFormatString
getDateFormat()
Returns the current date format.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.boolean
getQuote()
Returns whether to quote the sub-strings when generating string output.String
getSeparator()
Returns the separator in use.String
globalInfo()
Returns a string describing the object.String
quoteTipText()
Returns the tip text for this property.String
separatorTipText()
Returns the tip text for this property.void
setDateFormat(adams.data.DateFormatString value)
Sets the date format.void
setQuote(boolean value)
Sets whether to quote the sub-strings when generating string output.void
setSeparator(String value)
Sets the separator to use.-
Methods inherited from class adams.data.twitter.AbstractTwitterStatusConverter
check, convert, fieldsTipText, getFields, setFields
-
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
-
-
-
-
Field Detail
-
m_Separator
protected String m_Separator
the separator, when generating a string.
-
m_Quote
protected boolean m_Quote
whether to quote strings.
-
m_DateFormat
protected adams.data.DateFormatString m_DateFormat
for format for dates.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classAbstractTwitterStatusConverter<String>
-
setSeparator
public void setSeparator(String value)
Sets the separator to use. \t, \n, \r, \\ must be quoted.- Parameters:
value
- the separator
-
getSeparator
public String getSeparator()
Returns the separator in use. \t, \r, \n, \\ get returned quoted.- Returns:
- the separator
-
separatorTipText
public String separatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setQuote
public void setQuote(boolean value)
Sets whether to quote the sub-strings when generating string output.- Parameters:
value
- if true then the sub-strings get quoted
-
getQuote
public boolean getQuote()
Returns whether to quote the sub-strings when generating string output.- Returns:
- true if quoting enabled
-
quoteTipText
public String quoteTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDateFormat
public void setDateFormat(adams.data.DateFormatString value)
Sets the date format.- Parameters:
value
- the separator
-
getDateFormat
public adams.data.DateFormatString getDateFormat()
Returns the current date format.- Returns:
- the date format
-
dateFormatTipText
public String dateFormatTipText()
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 interfaceadams.core.QuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractTwitterStatusConverter<String>
- Returns:
- null if no info available, otherwise short string
-
generates
public Class generates()
Returns the class of the output data that is generated.- Specified by:
generates
in classAbstractTwitterStatusConverter<String>
- Returns:
- the data type
-
doConvert
protected String doConvert(Hashtable<TwitterField,Object> fields)
Performs the actual conversion.- Specified by:
doConvert
in classAbstractTwitterStatusConverter<String>
- Parameters:
fields
- the status data to convert- Returns:
- the generated output
-
-