Package adams.data.map
Class MapToPlainText
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,MapToString,Serializable
public class MapToPlainText extends AbstractMapToString
Turns a map object into a plain-text string.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected MapToStringm_Conversionthe actual conversion.protected intm_Indentationhow many spaces to use for indentation.protected booleanm_SortKeyswhether to sort the keys.-
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 MapToPlainText()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.intgetIndentation()Returns the number of spaces to use for indentation.booleangetSortKeys()Returns whether to sort the keys before generating the output.StringglobalInfo()Returns a string describing the object.StringindentationTipText()Returns the tip text for this property.voidsetIndentation(int value)Sets the number of spaces to use for indentation.voidsetSortKeys(boolean value)Sets whether to sort the keys before generating the output.StringsortKeysTipText()Returns the tip text for this property.protected StringtoString(Map map)Converts the map into a string.-
Methods inherited from class adams.data.map.AbstractMapToString
check, mapToString
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
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
-
-
-
-
Field Detail
-
m_SortKeys
protected boolean m_SortKeys
whether to sort the keys.
-
m_Indentation
protected int m_Indentation
how many spaces to use for indentation.
-
m_Conversion
protected transient MapToString m_Conversion
the actual conversion.
-
-
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 classAbstractOptionHandler
-
setSortKeys
public void setSortKeys(boolean value)
Sets whether to sort the keys before generating the output.- Parameters:
value- true if to sort the keys
-
getSortKeys
public boolean getSortKeys()
Returns whether to sort the keys before generating the output.- Returns:
- true if to sort the keys
-
sortKeysTipText
public String sortKeysTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setIndentation
public void setIndentation(int value)
Sets the number of spaces to use for indentation.- Parameters:
value- the number of spaces
-
getIndentation
public int getIndentation()
Returns the number of spaces to use for indentation.- Returns:
- the number of spaces
-
indentationTipText
public String indentationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
toString
protected String toString(Map map)
Converts the map into a string.- Specified by:
toStringin classAbstractMapToString- Parameters:
map- the map to convert- Returns:
- the generated string
-
-