|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Annotation
Annotation is container for holding a set of user-defined,
descriptive data elements. Annotations can be added to FileElements.
An Annotation has a key (String) and a set of values associated
with it. Annotation values are designed to be searchable.
Here is an example:
Say the user has an Image of a beach at sunset. They might create
an Annotation that has the key "Category" and one value "landscape".
They might then create a further Annotation that has the key
"Key words" and values "beach", "sunset", "Hawaii", etc. They might
then create a further Annotation with the key "Description" and one
value "Taken while on holiday in 2002". You get the idea.
Notice that the method to add an annotation value takes an Object
as argument. For this assignment, only Strings will be added as
annotation values. However, the design allows for arbitrary objects
to be added as annotation values. This would allow for non-text
annotation values (e.g. sound bites, icons etc).
Serializable
Method Summary | |
---|---|
void |
addAnnotationValue(java.lang.Object value)
Add a value to this annotation. |
java.lang.String |
getAnnotationKey()
Return this Annotation's key |
java.util.Collection |
getValues()
Get a collection encapsulating all the values in this Annotation. |
boolean |
removeAnnotationValue(java.lang.Object value)
Remove a value from this Annotation. |
void |
setAnnotationKey(java.lang.String text)
Set the String to use as this Annotation's key. |
java.lang.String |
toString()
Return a formatted String description of this Annotation. |
Method Detail |
---|
void setAnnotationKey(java.lang.String text)
text
- the value to use as the key
java.lang.String getAnnotationKey()
void addAnnotationValue(java.lang.Object value)
value
- an Object (typically a String) to associate with
this Annotation.
boolean removeAnnotationValue(java.lang.Object value)
value
- the Object value to remove from this Annotation.
java.util.Collection getValues()
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |