Package org.biojava.bio
Class AnnotationRenamer
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.AbstractAnnotation
-
- org.biojava.bio.AnnotationRenamer
-
- All Implemented Interfaces:
Serializable
,Annotation
,Changeable
public class AnnotationRenamer extends AbstractAnnotation
AnnotationRenamer
remaps the keys of anAnnotation
to new keys specified by aTagMapper
. This will rename properties, but not alter their values. For writing light-weigth adaptors to project one type of Annotation to another using a TagMapper.- Since:
- 1.3
- Author:
- Matthew Pocock, Keith James (docs)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.Annotation
EMPTY_ANNOTATION, PROPERTY
-
-
Constructor Summary
Constructors Constructor Description AnnotationRenamer(Annotation wrapped, PropertyChanger mapper)
Creates a newAnnotationRenamer
using the specifiedTagMapper
to remap its keys.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyChanger
getMapper()
getMapper
returns theTagMapper
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
Javadoc FIXME - this overrides a protected method and I'm not sure why (KJ).-
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
-
AnnotationRenamer
public AnnotationRenamer(Annotation wrapped, PropertyChanger mapper)
Creates a newAnnotationRenamer
using the specifiedTagMapper
to remap its keys.- Parameters:
wrapped
- anAnnotation
.mapper
- aTagMapper
.
-
-
Method Detail
-
getWrapped
public Annotation getWrapped()
getWrapped
returns theAnnotation
being remapped.- Returns:
- an
Annotation
.
-
getMapper
public PropertyChanger getMapper()
getMapper
returns theTagMapper
being used to remap theAnnotation
.- Returns:
- a
TagMapper
.
-
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
Javadoc FIXME - this overrides a protected method and I'm not sure why (KJ).- Specified by:
propertiesAllocated
in classAbstractAnnotation
- Returns:
- a
boolean
.
-
-