hep.aida.ref
Class Annotation
- java.lang.Object
-
- hep.aida.ref.Annotation
-
- All Implemented Interfaces:
- IAnnotation, java.lang.Cloneable
public class Annotation extends java.lang.Object implements IAnnotation, java.lang.Cloneable
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringaidaPathKeystatic java.lang.StringfullPathKeystatic java.lang.StringtitleKey
-
Constructor Summary
Constructors Constructor and Description Annotation()Creates a new instance of Annotation.Annotation(IAnnotation an)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddItem(java.lang.String key, java.lang.String value)Add a key/value pair with a given visibility.voidaddItem(java.lang.String key, java.lang.String value, boolean sticky)Add a key/value pair with a given sticky flag.java.lang.Objectclone()intfindKey(java.lang.String key)Find the index of a key.booleanhasKey(java.lang.String key)Check if a given key exists in IAnnotationbooleanisFillable()booleanisSticky(int index)Get the stickyness corresponding to the item in a give position in the Annotation.booleanisSticky(java.lang.String key)Get the stickyness for a given key.java.lang.Stringkey(int index)Get the key corresponding to the item in a given position in the Annotation.voidremoveItem(java.lang.String key)Remove the item indicated by a given key.voidreset()Reset the contents of the Annotation.voidsetFillable(boolean fillable)If annotation is fillable, can modified.voidsetSticky(java.lang.String key, boolean sticky)Set stickyness for a given key.voidsetValue(java.lang.String key, java.lang.String value)Set value for a given key.intsize()Get the number of items in the Annotation.java.lang.Stringvalue(int index)Get the value corresponding to the item in a given position in the Annotation.java.lang.Stringvalue(java.lang.String key)Retrieve the value for a given key.
-
-
-
Field Detail
-
titleKey
public static java.lang.String titleKey
-
aidaPathKey
public static java.lang.String aidaPathKey
-
fullPathKey
public static java.lang.String fullPathKey
-
-
Constructor Detail
-
Annotation
public Annotation()
Creates a new instance of Annotation.
-
Annotation
public Annotation(IAnnotation an)
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
setFillable
public void setFillable(boolean fillable)
If annotation is fillable, can modified. othervisw throws ReadOnlyException.
-
isFillable
public boolean isFillable()
-
addItem
public void addItem(java.lang.String key, java.lang.String value)Add a key/value pair with a given visibility.- Specified by:
addItemin interfaceIAnnotation- Parameters:
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 isfalse.
-
addItem
public void addItem(java.lang.String key, java.lang.String value, boolean sticky)Description copied from interface:IAnnotationAdd a key/value pair with a given sticky flag. If key alredy exists, its value is overwritten.- Specified by:
addItemin interfaceIAnnotation- Parameters:
key- The key to be added.value- The key's value.sticky- The key's sticky flag. Iftruethe item will not be removed when the method reset or removeItem are invoked. The default value for the sticky flag isfalse.
-
removeItem
public void removeItem(java.lang.String key)
Remove the item indicated by a given key.- Specified by:
removeItemin interfaceIAnnotation- Parameters:
key- The key to be removed. If the key is flagged as "sticky" it will not be removed.
-
value
public java.lang.String value(java.lang.String key)
Retrieve the value for a given key.- Specified by:
valuein interfaceIAnnotation- Parameters:
key- The key.- Returns:
- The value of the corresponding item.
-
setValue
public void setValue(java.lang.String key, java.lang.String value)Set value for a given key.- Specified by:
setValuein interfaceIAnnotation- Parameters:
key- The item's key.value- The new value for the correponding item.
-
isSticky
public boolean isSticky(java.lang.String key)
Get the stickyness for a given key.- Specified by:
isStickyin interfaceIAnnotation- Parameters:
key- The item's key.- Returns:
- The stickyness for the corresponding item.
-
setSticky
public void setSticky(java.lang.String key, boolean sticky)Set stickyness for a given key.- Specified by:
setStickyin interfaceIAnnotation- Parameters:
key- The item's key.sticky- The new stickyness for the correponding item.
-
size
public int size()
Get the number of items in the Annotation.- Specified by:
sizein interfaceIAnnotation- Returns:
- The size of the Annotation.
-
key
public java.lang.String key(int index)
Get the key corresponding to the item in a given position in the Annotation.- Specified by:
keyin interfaceIAnnotation- Parameters:
index- The item's index.- Returns:
- The corresponding key.
-
value
public java.lang.String value(int index)
Get the value corresponding to the item in a given position in the Annotation.- Specified by:
valuein interfaceIAnnotation- Parameters:
index- The item's index.- Returns:
- The corresponding value.
-
isSticky
public boolean isSticky(int index)
Get the stickyness corresponding to the item in a give position in the Annotation.- Parameters:
index- The item's index.- Returns:
- The stickyness for the corresponding item.
-
reset
public void reset()
Reset the contents of the Annotation.- Specified by:
resetin interfaceIAnnotation
-
findKey
public int findKey(java.lang.String key)
Description copied from interface:IAnnotationFind the index of a key.- Specified by:
findKeyin interfaceIAnnotation- Parameters:
key- The key to find.- Returns:
- The key index. Return -1 if not found.
-
hasKey
public boolean hasKey(java.lang.String key)
Description copied from interface:IAnnotationCheck if a given key exists in IAnnotation- Specified by:
hasKeyin interfaceIAnnotation- Parameters:
key- The item's key.- Returns:
- true if the key exists.
-
-
DMelt 3.0 © DataMelt by jWork.ORG