Package adams.core.base
Class AbstractBaseString
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
- Direct Known Subclasses:
AbstractActorReference
,AbstractAdvancedScript
,AbstractSimpleScript
,ArrayDimensions
,BaseCharset
,BaseClassname
,BaseCommandLine
,BaseDimension
,BaseHostname
,BaseInterval
,BaseKeyValuePair
,BaseList
,BaseMarkdown
,BasePassword
,BasePointDouble
,BasePointFloat
,BasePointInt
,BaseRectangle
,BaseRegExp
,BaseShortcut
,BaseString
,BaseText
,ByteFormatString
,CronSchedule
,DateFormatString
,DecimalFormatString
,EmailAddress
,JdbcUrl
,JsonPathExpression
,LabeledRectangle
,Mat5ArrayDimensions
,Mat5ArrayElementIndex
,MatrixSubset
,MavenArtifact
,MavenArtifactExclusion
,MavenRepository
,MicroSecondFormatString
,QuadrilateralLocation
,RangedThreshold
,SecondFormatString
,StorageName
,VariableName
,VariableNameStorageNamePair
,VariableNameValuePair
,XPathExpression
public abstract class AbstractBaseString extends BaseObject
Wrapper for a String object to be editable in the GOE.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBaseString()
Initializes the string with length 0.protected
AbstractBaseString(String s)
Initializes the object with the string to parse.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
convert(String value)
Converts the string according to the specified conversion.abstract String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).String
getValue()
Returns the current string value.protected void
initialize()
Initializes the internal object.boolean
isEmpty()
Whether the string is empty, i.e., "".boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.int
length()
Returns the length of the string.void
setValue(String value)
Sets the string value.String
stringValue()
Returns the String value.-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hasFavoritesSupport, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Constructor Detail
-
AbstractBaseString
protected AbstractBaseString()
Initializes the string with length 0.
-
AbstractBaseString
protected AbstractBaseString(String s)
Initializes the object with the string to parse.- Parameters:
s
- the string to parse
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the internal object.
Uses empty string.- Overrides:
initialize
in classBaseObject
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Specified by:
isValid
in classBaseObject
- Parameters:
value
- the string value to check- Returns:
- true if non-null
-
convert
protected String convert(String value)
Converts the string according to the specified conversion.
Default implementation performs no conversion.- Parameters:
value
- the string to convert- Returns:
- the converted string
-
setValue
public void setValue(String value)
Sets the string value.
Callsconvert(String)
first before checking validity or setting the value (if valid).- Specified by:
setValue
in classBaseObject
- Parameters:
value
- the string value
-
getValue
public String getValue()
Returns the current string value.- Specified by:
getValue
in classBaseObject
- Returns:
- the string value
-
stringValue
public String stringValue()
Returns the String value.- Returns:
- the String value
-
isEmpty
public boolean isEmpty()
Whether the string is empty, i.e., "".- Returns:
- true if the string is empty, i.e., length 0
-
length
public int length()
Returns the length of the string.- Returns:
- the length
-
getTipText
public abstract String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classBaseObject
- Returns:
- the tool tip
-
-