hep.aida.ref
Class Annotation

java.lang.Object
  extended by hep.aida.ref.Annotation
All Implemented Interfaces:
IAnnotation, Cloneable

public class Annotation
extends Object
implements IAnnotation, Cloneable


Field Summary
static String aidaPathKey
           
static String fullPathKey
           
static String titleKey
           
 
Constructor Summary
Annotation()
          Creates a new instance of Annotation.
Annotation(IAnnotation an)
           
 
Method Summary
 void addItem(String key, String value)
          Add a key/value pair with a given visibility.
 void addItem(String key, String value, boolean sticky)
          Add a key/value pair with a given sticky flag.
 Object clone()
           
 int findKey(String key)
          Find the index of a key.
 boolean hasKey(String key)
          Check if a given key exists in IAnnotation
 boolean isFillable()
           
 boolean isSticky(int index)
          Get the stickyness corresponding to the item in a give position in the Annotation.
 boolean isSticky(String key)
          Get the stickyness for a given key.
 String key(int index)
          Get the key corresponding to the item in a given position in the Annotation.
 void removeItem(String key)
          Remove the item indicated by a given key.
 void reset()
          Reset the contents of the Annotation.
 void setFillable(boolean fillable)
          If annotation is fillable, can modified.
 void setSticky(String key, boolean sticky)
          Set stickyness for a given key.
 void setValue(String key, String value)
          Set value for a given key.
 int size()
          Get the number of items in the Annotation.
 String value(int index)
          Get the value corresponding to the item in a given position in the Annotation.
 String value(String key)
          Retrieve the value for a given key.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

titleKey

public static String titleKey

aidaPathKey

public static String aidaPathKey

fullPathKey

public static String fullPathKey
Constructor Detail

Annotation

public Annotation()
Creates a new instance of Annotation.


Annotation

public Annotation(IAnnotation an)
Method Detail

clone

public Object clone()
Overrides:
clone in class Object

setFillable

public void setFillable(boolean fillable)
If annotation is fillable, can modified. othervisw throws ReadOnlyException.


isFillable

public boolean isFillable()

addItem

public void addItem(String key,
                    String value)
Add a key/value pair with a given visibility.

Specified by:
addItem in interface IAnnotation
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 is false.

addItem

public void addItem(String key,
                    String value,
                    boolean sticky)
Description copied from interface: IAnnotation
Add a key/value pair with a given sticky flag. If key alredy exists, its value is overwritten.

Specified by:
addItem in interface IAnnotation
Parameters:
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.

removeItem

public void removeItem(String key)
Remove the item indicated by a given key.

Specified by:
removeItem in interface IAnnotation
Parameters:
key - The key to be removed. If the key is flagged as "sticky" it will not be removed.

value

public String value(String key)
Retrieve the value for a given key.

Specified by:
value in interface IAnnotation
Parameters:
key - The key.
Returns:
The value of the corresponding item.

setValue

public void setValue(String key,
                     String value)
Set value for a given key.

Specified by:
setValue in interface IAnnotation
Parameters:
key - The item's key.
value - The new value for the correponding item.

isSticky

public boolean isSticky(String key)
Get the stickyness for a given key.

Specified by:
isSticky in interface IAnnotation
Parameters:
key - The item's key.
Returns:
The stickyness for the corresponding item.

setSticky

public void setSticky(String key,
                      boolean sticky)
Set stickyness for a given key.

Specified by:
setSticky in interface IAnnotation
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:
size in interface IAnnotation
Returns:
The size of the Annotation.

key

public String key(int index)
Get the key corresponding to the item in a given position in the Annotation.

Specified by:
key in interface IAnnotation
Parameters:
index - The item's index.
Returns:
The corresponding key.

value

public String value(int index)
Get the value corresponding to the item in a given position in the Annotation.

Specified by:
value in interface IAnnotation
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:
reset in interface IAnnotation

findKey

public int findKey(String key)
Description copied from interface: IAnnotation
Find the index of a key.

Specified by:
findKey in interface IAnnotation
Parameters:
key - The key to find.
Returns:
The key index. Return -1 if not found.

hasKey

public boolean hasKey(String key)
Description copied from interface: IAnnotation
Check if a given key exists in IAnnotation

Specified by:
hasKey in interface IAnnotation
Parameters:
key - The item's key.
Returns:
true if the key exists.


jHepWork 3.2 © jWork.org