Package adams.data.twitter
Class AbstractTwitterStatusConverter<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.twitter.AbstractTwitterStatusConverter<T>
-
- Type Parameters:
T
- the type of output data to generate
- 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
- Direct Known Subclasses:
SpreadSheetConverter
,TextConverter
public abstract class AbstractTwitterStatusConverter<T> extends adams.core.option.AbstractOptionHandler implements adams.core.QuickInfoSupporter
Ancestor for classes that convert tweets into a different data structure.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TwitterField[]
m_Fields
the fields to generate the output from.
-
Constructor Summary
Constructors Constructor Description AbstractTwitterStatusConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check(twitter4j.Status status)
Checks whether the status can be converted.T
convert(twitter4j.Status status)
Performs the conversion.void
defineOptions()
Adds options to the internal list of options.protected abstract T
doConvert(Hashtable<TwitterField,Object> fields)
Performs the actual conversion.String
fieldsTipText()
Returns the tip text for this property.abstract Class
generates()
Returns the class of the output data that is generated.TwitterField[]
getFields()
Returns the fields to generate the output from.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.void
setFields(TwitterField[] value)
Sets fields to generate the output from.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Fields
protected TwitterField[] m_Fields
the fields to generate the output from.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setFields
public void setFields(TwitterField[] value)
Sets fields to generate the output from.- Parameters:
value
- the fields
-
getFields
public TwitterField[] getFields()
Returns the fields to generate the output from.- Returns:
- the fields
-
fieldsTipText
public String fieldsTipText()
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
- Returns:
- null if no info available, otherwise short string
-
generates
public abstract Class generates()
Returns the class of the output data that is generated.- Returns:
- the data type
-
check
protected void check(twitter4j.Status status)
Checks whether the status can be converted.- Parameters:
status
- the status to check
-
doConvert
protected abstract T doConvert(Hashtable<TwitterField,Object> fields)
Performs the actual conversion.- Parameters:
fields
- the status data to convert- Returns:
- the generated output
-
convert
public T convert(twitter4j.Status status)
Performs the conversion.- Parameters:
status
- the status to convert- Returns:
- the generated output
-
-