Package adams.core.tags
Class Tag
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.tags.Tag
-
- All Implemented Interfaces:
CloneHandler<BaseObject>,Serializable,Comparable
public class Tag extends AbstractBaseString
Wrapper for a tag (key/value pair).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSEPARATORthe separator.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Tag[]fromMap(Map<String,String> map)Turns the string map into pairs.StringgetTipText()Returns a tool tip for the GUI editor (ignored if null is returned).booleanisValid(String value)Checks whether the string value is a valid presentation for this class.StringpairValue()Returns the backquoted pair (name=value).StringtagName()Returns the name part.StringtagValue()Returns the value part.static Map<String,String>toMap(Tag[] pairs)Turns the array into a string map.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, initialize, isEmpty, length, setValue, stringValue
-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hasFavoritesSupport, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
the separator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Tag
public Tag()
Initializes the string with length 0.
-
Tag
public Tag(String key, String value)
Initializes the object with the key/value pair.- Parameters:
key- the key to usevalue- the value to use
-
Tag
public Tag(String s)
Initializes the object with the string to parse.- Parameters:
s- the string to parse
-
-
Method Detail
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValidin classAbstractBaseString- Parameters:
value- the string value to check- Returns:
- true if non-null
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipTextin classAbstractBaseString- Returns:
- the tool tip
-
pairValue
public String pairValue()
Returns the backquoted pair (name=value).- Returns:
- the backquoted pair
-
tagName
public String tagName()
Returns the name part.- Returns:
- the key
-
tagValue
public String tagValue()
Returns the value part.- Returns:
- the value
-
toMap
public static Map<String,String> toMap(Tag[] pairs)
Turns the array into a string map.- Parameters:
pairs- the key/value pairs to use- Returns:
- the generated map
-
-