|
FreeHEP API Version 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The annotation holds arbitrary information represented with (key,value) pairs of strings. A sticky bit is associated to every item to protect it (or not) from a reset operation.
Field Summary | |
static String |
titleKey
The list of the commonly accepted keys. |
Method Summary | |
void |
addItem(String key,
String value)
Add a key/value pair with a given sticky flag. |
void |
addItem(String key,
String value,
boolean sticky)
Add a key/value pair with a given sticky flag. |
String |
key(int index)
Get the key at a given position within the IAnnotation. |
void |
removeItem(String key)
Remove the item indicated by a given key. |
void |
reset()
Remove all the non-sticky items. |
void |
setSticky(String key,
boolean sticky)
Set the sticky flag for a given key. |
void |
setValue(String key,
String value)
Set the value for a given key. |
int |
size()
Get the size of the IAnnotation, i.e. the number of keys contained in it. |
String |
value(int index)
Get the value at a given position within the IAnnotation. |
String |
value(String key)
Retrieve the value for a given key. |
Field Detail |
public static final String titleKey
Method Detail |
public void addItem(String key, String value) throws IllegalArgumentException
key
- The key to be added.value
- The key's value.
not be removed when the method reset or removeItem are invoked.
The default value for the sticky flag is false
.
IllegalArgumentException
- If the key already exists.public void addItem(String key, String value, boolean sticky) throws IllegalArgumentException
key
- The key to be added.value
- The key's value.sticky
- The key's sticky flag. If true
the item will
not be removed when the method reset or removeItem are invoked.
The default value for the sticky flag is false
.
IllegalArgumentException
- If the key already exists.public void removeItem(String key) throws IllegalArgumentException
key
- The key to be removed. If the key is flagged as "sticky" it
will not be removed.
IllegalArgumentException
- If the key is sticky.public String value(String key)
key
- The key.
public void setValue(String key, String value)
key
- The key whose vale is to be changed.value
- The new value.public void setSticky(String key, boolean sticky)
key
- The key whose stick flag is to be set.sticky
- The new sticky flag.public int size()
public String key(int index)
index
- The key's position within the IAnnotation.
public String value(int index)
index
- The value's position within the IAnnotation.
public void reset()
|
FreeHEP API Version 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |