public class EmptyRichAnnotation extends Unchangeable implements RichAnnotation, Serializable
EMPTY_ANNOTATIONPROPERTY| Constructor and Description |
|---|
EmptyRichAnnotation() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNote(Note note)
Adds a note to this annotation.
|
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(Object key)
Returns whether there the property is defined.
|
boolean |
equals(Object o) |
Note |
getNote(Note note)
Uses the term and rank to lookup a note in this annotation.
|
Set |
getNoteSet()
Returns an immutable set of all notes in this annotation.
|
Note[] |
getProperties(Object key)
Find all the
Notes with any rank that match the key. |
Object |
getProperty(Object key)
Retrieve the value of a property by key.
|
int |
hashCode() |
Set |
keys()
Get a set of key objects.
|
void |
removeNote(Note note)
Removes a note from this annotation.
|
void |
removeProperty(Object key)
Delete a property.
|
void |
setNoteSet(Set notes)
Clears the notes from this annotation and replaces them with
those from the given set.
|
void |
setProperty(Object key,
Object value)
Set the value of a property.
|
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic EmptyRichAnnotation()
public Object getProperty(Object key) throws 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. There are no properties in the Empty RichAnnotation object. Calling this will return null.getProperty in interface Annotationkey - the key of the property to retrieveNoSuchElementException - if there is no property with the keypublic Note[] getProperties(Object key)
Notes with any rank that match the key. There are no properties in the Empty RichAnnotation object.
Calling this will return an empty array.getProperties in interface RichAnnotationkey - either a String identifier of a term from the
default ontology or a ComparableTermNotes in order of rank or an
empty array if there are no matches. No implementation should ever
return null!Note,
ComparableTermpublic Note getNote(Note note)
getNote in interface RichAnnotationnote - note to lookup, using term and rank.public void setProperty(Object key, Object value) throws 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. You can not add properties to the Empty RichAnnotation objectsetProperty in interface Annotationkey - the key objectvalue - the new value for this keyChangeVetoException - whenever you call this method.public void setNoteSet(Set notes) throws ChangeVetoException
setNoteSet in interface RichAnnotationnotes - a set of Note objects to use from now on.ChangeVetoException - whenever you call this method.Notepublic void addNote(Note note) throws ChangeVetoException
addNote in interface RichAnnotationnote - note to addChangeVetoException - whenever you call this method.public void clear() throws ChangeVetoException
clear in interface RichAnnotationChangeVetoException - if it couldn't do it.public void removeProperty(Object key) throws ChangeVetoException
removeProperty in interface Annotationkey - the key objectChangeVetoException - whenever you call this method.public void removeNote(Note note) throws ChangeVetoException
removeNote in interface RichAnnotationnote - note to removeChangeVetoException - whenever you call this method.public boolean containsProperty(Object key)
containsProperty in interface Annotationkey - the key Object to search forpublic boolean contains(Note note)
contains in interface RichAnnotationnote - note to lookuppublic Set keys()
keys in interface Annotationpublic Set getNoteSet()
getNoteSet in interface RichAnnotationNotepublic Map asMap()
If the annotation changes, the map may not reflect this. The Map may be unmodifiable.
asMap in interface Annotationpublic int hashCode()
Copyright © 2020 BioJava. All rights reserved.