Package adams.core.base
Class BaseAnnotation.Tag
- java.lang.Object
-
- adams.core.base.BaseAnnotation.Tag
-
- All Implemented Interfaces:
Serializable
,Comparable<BaseAnnotation.Tag>
- Enclosing class:
- BaseAnnotation
public static class BaseAnnotation.Tag extends Object implements Serializable, Comparable<BaseAnnotation.Tag>
Container class for storing tag information.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(BaseAnnotation.Tag o)
Compares this object with the specified object for order.boolean
equals(Object obj)
Checks whether the two objects are the same.String
getName()
Returns the tag name.HashMap<String,String>
getOptions()
Returns the tag options.static BaseAnnotation.Tag
parse(String s)
Parses the tag string (!{...}) and generates a Tag object from it.String
toString()
Returns a short string representation of the tag.
-
-
-
Constructor Detail
-
Tag
public Tag(String name)
Instantiates the tag with the given name and options.- Parameters:
name
- the name of the tag
-
-
Method Detail
-
getName
public String getName()
Returns the tag name.- Returns:
- the name
-
getOptions
public HashMap<String,String> getOptions()
Returns the tag options.- Returns:
- the options
-
compareTo
public int compareTo(BaseAnnotation.Tag o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareTo
in interfaceComparable<BaseAnnotation.Tag>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
NullPointerException
- if the specified object is null
-
equals
public boolean equals(Object obj)
Checks whether the two objects are the same. Returns true if they are both tags with the same name and options.
-
toString
public String toString()
Returns a short string representation of the tag.
-
parse
public static BaseAnnotation.Tag parse(String s)
Parses the tag string (!{...}) and generates a Tag object from it. Format: !{name[:key=value[,key=value...]]}- Parameters:
s
- the string to parse- Returns:
- the tag or null if failed to parse
-
-