Package org.biojava.bio
Class AnnotationChanger
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.AbstractAnnotation
org.biojava.bio.AnnotationChanger
- All Implemented Interfaces:
Serializable,Annotation,Changeable
AnnotationChanger remaps the values of an
Annotation to new values specified by a
ValueChanger. This will modify the values
associated with properties, but not the property names.
For writing light-weigth adaptors to project one type of
Annotation to another using a ChangeTable.- Since:
- 1.3
- Author:
- Matthew Pocock
- See Also:
-
Field Summary
Fields inherited from interface org.biojava.bio.Annotation
EMPTY_ANNOTATION, PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationChanger(Annotation wrapped, ChangeTable changer) Creates a newAnnotationChangerusing the specifiedValueChangerto remap its values. -
Method Summary
Modifier and TypeMethodDescriptiongetMapperreturns theValueChangerbeing used to remap theAnnotation.getPropertiesreturns the mapped contents of the underlyingAnnotationas aMap.getWrappedreturns theAnnotationbeing remapped.booleanpropertiesAllocatedis a convenience method to see if we have allocated the propertiesMap.Methods 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
-
AnnotationChanger
Creates a newAnnotationChangerusing the specifiedValueChangerto remap its values.- Parameters:
wrapped- anAnnotation.changer- aValueChanger.
-
-
Method Details
-
getWrapped
getWrappedreturns theAnnotationbeing remapped.- Returns:
- an
Annotation.
-
getChanger
getMapperreturns theValueChangerbeing used to remap theAnnotation.- Returns:
- a
ValueChanger.
-
getProperties
getPropertiesreturns the mapped contents of the underlyingAnnotationas aMap.- Specified by:
getPropertiesin classAbstractAnnotation- Returns:
- a
Map.
-
propertiesAllocated
propertiesAllocatedis a convenience method to see if we have allocated the propertiesMap.- Specified by:
propertiesAllocatedin classAbstractAnnotation- Returns:
- a
booleantrue if the properties have been allocated, false otherwise.
-