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
public class AnnotationChanger extends AbstractAnnotation
AnnotationChanger
remaps the values of anAnnotation
to new values specified by aValueChanger
. 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.Annotation
EMPTY_ANNOTATION, PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AnnotationChanger(Annotation wrapped, ChangeTable changer)
Creates a newAnnotationChanger
using the specifiedValueChanger
to remap its values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeTable
getChanger()
getMapper
returns theValueChanger
being used to remap theAnnotation
.Map
getProperties()
getProperties
returns the mapped contents of the underlyingAnnotation
as aMap
.Annotation
getWrapped()
getWrapped
returns theAnnotation
being remapped.boolean
propertiesAllocated()
propertiesAllocated
is 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, toString
-
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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Constructor Detail
-
AnnotationChanger
public AnnotationChanger(Annotation wrapped, ChangeTable changer)
Creates a newAnnotationChanger
using the specifiedValueChanger
to remap its values.- Parameters:
wrapped
- anAnnotation
.changer
- aValueChanger
.
-
-
Method Detail
-
getWrapped
public Annotation getWrapped()
getWrapped
returns theAnnotation
being remapped.- Returns:
- an
Annotation
.
-
getChanger
public ChangeTable getChanger()
getMapper
returns theValueChanger
being used to remap theAnnotation
.- Returns:
- a
ValueChanger
.
-
getProperties
public Map getProperties()
getProperties
returns the mapped contents of the underlyingAnnotation
as aMap
.- Specified by:
getProperties
in classAbstractAnnotation
- Returns:
- a
Map
.
-
propertiesAllocated
public boolean propertiesAllocated()
propertiesAllocated
is a convenience method to see if we have allocated the propertiesMap
.- Specified by:
propertiesAllocated
in classAbstractAnnotation
- Returns:
- a
boolean
true if the properties have been allocated, false otherwise.
-
-