|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.biojava.utils.AbstractChangeable
|
+--org.biojava.bio.MergeAnnotation
Merged view onto a list of underlying Annotation objects. Currently immutable (but reflects changes to underlying objects). Annotations near the beginning of the list will have properties that take precedence. This Annotation implementation is immutable.
| Nested Class Summary | |
protected class |
MergeAnnotation.PropertyForwarder
|
| Field Summary |
| Fields inherited from interface org.biojava.bio.Annotation |
EMPTY_ANNOTATION, PROPERTY |
| Constructor Summary | |
MergeAnnotation()
|
|
| Method Summary | |
void |
addAnnotation(Annotation ann)
Add a new Annotation to the list to be merged. |
java.util.Map |
asMap()
Return a Map view onto this annotation. |
boolean |
containsProperty(java.lang.Object key)
Returns whether there the property is defined. |
protected ChangeSupport |
getChangeSupport(ChangeType changeType)
Called to retrieve the ChangeSupport for this object |
java.lang.Object |
getProperty(java.lang.Object key)
Retrieve the value of a property by key. |
java.util.Set |
keys()
Return a Set containing all key objects
visible in this annotation. |
void |
removeProperty(java.lang.Object key)
Delete a property |
void |
setProperty(java.lang.Object key,
java.lang.Object value)
Set the value of a property. |
| Methods inherited from class org.biojava.utils.AbstractChangeable |
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Constructor Detail |
public MergeAnnotation()
| Method Detail |
public void addAnnotation(Annotation ann)
throws ChangeVetoException
ann - the Annotation to add
ChangeVetoExceptionprotected ChangeSupport getChangeSupport(ChangeType changeType)
AbstractChangeable
getChangeSupport in class AbstractChangeable
public void setProperty(java.lang.Object key,
java.lang.Object value)
throws ChangeVetoException
AnnotationSet 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.
setProperty in interface Annotationkey - the key objectvalue - the new value for this key
ChangeVetoException - if this annotation object can't be changed, or
if the change was vetoed
public void removeProperty(java.lang.Object key)
throws ChangeVetoException
Annotation
removeProperty in interface Annotationkey - the key object
ChangeVetoException - if the change is vetoedpublic java.lang.Object getProperty(java.lang.Object key)
AnnotationRetrieve 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.
getProperty in interface Annotationkey - the key of the property to retrieve
public boolean containsProperty(java.lang.Object key)
Annotation
containsProperty in interface Annotationkey - the key Object to search for
public java.util.Set keys()
Set containing all key objects
visible in this annotation. The Set is
unmodifiable, but will dynamically reflect changes made
to the annotation.
keys in interface Annotationpublic java.util.Map asMap()
Map view onto this annotation.
The returned Map is unmodifiable, but will
dynamically reflect any changes made to this annotation.
asMap in interface Annotation
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||