Package org.biojava.bio
Class SimpleAnnotation
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.AbstractAnnotation
org.biojava.bio.SimpleAnnotation
- All Implemented Interfaces:
Serializable,Annotation,Changeable
A no-frills implementation of Annotation that is just a wrapper
around a LinkedHashMap.
It will allow you to set any property, but will throw exceptions
if you try to retrieve a property that is not set. Because of the use of
a LinkedHashMap properties are iterated in the order they
are entered.
- Since:
- 1.0
- Author:
- Matthew Pocock, Greg Cox, Mark Schreiber
- See Also:
-
Field Summary
Fields inherited from interface org.biojava.bio.Annotation
EMPTY_ANNOTATION, PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new, empty SimpleAnnotation instance.SimpleAnnotation(Map map) Create a new SimpleAnnotation using the values in a Map.Create a new SimpleAnnotation by copying the properties from another one. -
Method Summary
Modifier and TypeMethodDescriptionprotected final MapGet the property value pairs in this annotationprotected final booleanTest to see if any properties have been allocatedMethods inherited from class org.biojava.bio.AbstractAnnotation
asMap, containsProperty, equals, getProperty, hashCode, keys, removeProperty, setProperty, toStringMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
SimpleAnnotation
public SimpleAnnotation()Create a new, empty SimpleAnnotation instance. -
SimpleAnnotation
Create a new SimpleAnnotation by copying the properties from another one. The new Annotation instance will be independant of the original.- Parameters:
ann- the Annotation to copy
-
SimpleAnnotation
Create a new SimpleAnnotation using the values in a Map.- Parameters:
map- the Map to copy properties out of
-
-
Method Details
-
getProperties
Get the property value pairs in this annotation- Specified by:
getPropertiesin classAbstractAnnotation- Returns:
- a
LinkedHashMapof properties and values
-
propertiesAllocated
Test to see if any properties have been allocated- Specified by:
propertiesAllocatedin classAbstractAnnotation- Returns:
- true if any have (even if they have since been removed), false otherwise
-