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,Tag,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 protectedAbstractBaseString()Initializes the string with length 0.protectedAbstractBaseString(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 Stringconvert(String value)Converts the string according to the specified conversion.abstract StringgetTipText()Returns a tool tip for the GUI editor (ignored if null is returned).StringgetValue()Returns the current string value.protected voidinitialize()Initializes the internal object.booleanisEmpty()Whether the string is empty, i.e., "".booleanisValid(String value)Checks whether the string value is a valid presentation for this class.intlength()Returns the length of the string.voidsetValue(String value)Sets the string value.StringstringValue()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:
initializein classBaseObject
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Specified by:
isValidin 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:
setValuein classBaseObject- Parameters:
value- the string value
-
getValue
public String getValue()
Returns the current string value.- Specified by:
getValuein 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:
getTipTextin classBaseObject- Returns:
- the tool tip
-
-