|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojavax.SimpleRichAnnotation
public class SimpleRichAnnotation
Simple annotation wrapper. All non-Note annotations get a rank of zero.
| Field Summary |
|---|
| Fields inherited from interface org.biojavax.RichAnnotation |
|---|
EMPTY_ANNOTATION |
| Fields inherited from interface org.biojava.bio.Annotation |
|---|
PROPERTY |
| Constructor Summary | |
|---|---|
SimpleRichAnnotation()
Creates a new, empty instance of SimpleRichAnnotation |
|
| Method Summary | |
|---|---|
void |
addNote(Note note)
Adds a note to this annotation. |
java.util.Map |
asMap()
Return a map that contains the same key/values as this Annotation. |
void |
clear()
Removes all notes from this annotation object. |
boolean |
contains(Note note)
Returns true if the given note exists in this annotation. |
boolean |
containsProperty(java.lang.Object key)
Deprecated. |
Note |
getNote(Note note)
Uses the term and rank to lookup a note in this annotation. |
java.util.Set |
getNoteSet()
Returns an immutable set of all notes in this annotation. |
Note[] |
getProperties(java.lang.Object key)
Deprecated. |
java.lang.Object |
getProperty(java.lang.Object key)
Deprecated. |
java.util.Set |
keys()
Get a set of key objects. |
void |
removeNote(Note note)
Removes a note from this annotation. |
void |
removeProperty(java.lang.Object key)
Deprecated. |
void |
setNoteSet(java.util.Set notes)
Clears the notes from this annotation and replaces them with those from the given set. |
void |
setProperty(java.lang.Object key,
java.lang.Object value)
Deprecated. |
java.lang.String |
toString()
Form: list of "[note]" values separated by commas |
| Methods inherited from class org.biojava.utils.AbstractChangeable |
|---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
|---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Constructor Detail |
|---|
public SimpleRichAnnotation()
| Method Detail |
|---|
public void clear()
throws ChangeVetoException
clear in interface RichAnnotationChangeVetoException - if it couldn't do it.public java.util.Map asMap()
If the annotation changes, the map may not reflect this. The Map
may be unmodifiable.
The map is a copy of the internal structure. It is a map of
ComparableTerms to Strings corresponding
to the Term and Value of the Notes in the annotation.
asMap in interface Annotation
public void addNote(Note note)
throws ChangeVetoException
addNote in interface RichAnnotationnote - note to add
ChangeVetoException - if it doesn't like this.public boolean contains(Note note)
contains in interface RichAnnotationnote - note to lookup
public boolean containsProperty(java.lang.Object key)
containsProperty in interface Annotationkey - the key Object to search for
public Note getNote(Note note)
throws java.util.NoSuchElementException
getNote in interface RichAnnotationnote - note to lookup, using term and rank.
java.util.NoSuchElementException - if it couldn't be found.
public java.lang.Object getProperty(java.lang.Object key)
throws java.util.NoSuchElementException
Retrieve the value of a property by key.
Unlike the Map collections, it will complain if the key does not exist. It will only return null if the key is defined and has value null.
Normal raw access to the property. For cleverer access, use methods in AnnotationType. Strictly it will return the firstNote which matches the
key (or a Term made with a String key)..
getProperty in interface Annotationkey - the key of the property to retrieve
java.util.NoSuchElementException - if there is no property with the keygetProperties(Object key)public Note[] getProperties(java.lang.Object key)
Notes with any rank that match the key.
Strictly it will return all Notes which match the
key (or a Term made with a String key)..
getProperties in interface RichAnnotationkey - either a String identifier of a term from the
default onltology or a ComparableTerm
Notes in order of rank or an
empty array if there are no matches. No implementation should ever
return null!Note,
ComparableTermpublic java.util.Set keys()
keys in interface Annotation
public void removeNote(Note note)
throws ChangeVetoException
removeNote in interface RichAnnotationnote - note to remove
ChangeVetoException - if it doesn't like this.
public void removeProperty(java.lang.Object key)
throws java.util.NoSuchElementException,
ChangeVetoException
Note which matches the
key (or a Term made with a String key)..
removeProperty in interface Annotationkey - the key object
java.util.NoSuchElementException - if the property doesn't exist
ChangeVetoException - if the change is vetoed
public void setProperty(java.lang.Object key,
java.lang.Object value)
throws java.lang.IllegalArgumentException,
ChangeVetoException
Set the value of a property.
This method throws an exception if either properties can not be added to this object, or that this particular property is immutable or illegal within the implementation.
Normal raw access to the property. For cleverer access, use methods in AnnotationType.
setProperty in interface Annotationkey - the key objectvalue - the new value for this key
java.lang.IllegalArgumentException - if the property key is not
legal
ChangeVetoException - if this annotation object can't be changed, or
if the change was vetoed.public java.util.Set getNoteSet()
getNoteSet in interface RichAnnotationNote
public void setNoteSet(java.util.Set notes)
throws ChangeVetoException
setNoteSet in interface RichAnnotationnotes - a set of Note objects to use from now on.
ChangeVetoException - if it doesn't like any of them.Notepublic 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 | |||||||||