|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.util.TransformerMap
This TansformerMap automates the transformation of of mixed object types.
It provides a means to set NumberTransformers that will be selected
based on the Class of the object handed to the Maps
double transform(Object o)
method.
Constructor Summary | |
TransformerMap()
|
Method Summary | |
Set |
classes()
Returns the Set of Classes used as keys in the map. |
void |
clear()
Clears all the Class to Transformer mappings. |
boolean |
containsClass(Class key)
Tests if a Class is present in the TransformerMap. |
boolean |
containsTransformer(NumberTransformer value)
Tests if a NumberTransformer is present in the TransformerMap. |
NumberTransformer |
getTransformer(Class key)
Returns the Transformer that is mapped to a class if mapping is not present, this returns null. |
Object |
putTransformer(Class key,
NumberTransformer transformer)
Sets a Class to Transformer Mapping in the Map. |
Object |
removeTransformer(Class key)
Removes a Class to Transformer Mapping in the Map. |
double |
transform(Object o)
Attempts to transform the Object against the map of NumberTransformers. |
Collection |
transformers()
Returns the Set of NumberTransformers used as values in the map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransformerMap()
Method Detail |
public boolean containsClass(Class key)
key
- Class to check
public boolean containsTransformer(NumberTransformer value)
value
- NumberTransformer to check
public NumberTransformer getTransformer(Class key)
key
- The Class of the object
public Object putTransformer(Class key, NumberTransformer transformer)
key
- The Classtransformer
- The NumberTransformer
public Object removeTransformer(Class key)
key
- The Class
public void clear()
public Set classes()
public Collection transformers()
public double transform(Object o) throws MathException
transform
in interface NumberTransformer
o
- the Object to be transformed.
MathException
- if the Object can not be transformed into a Double.NumberTransformer.transform(java.lang.Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |