public class TransformerMap extends Object implements NumberTransformer, Serializable
double transform(Object o)
method.Constructor and Description |
---|
TransformerMap()
Build a map containing only the default transformer.
|
Modifier and Type | Method and Description |
---|---|
Set<Class<?>> |
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.
|
boolean |
equals(Object other) |
NumberTransformer |
getTransformer(Class<?> key)
Returns the Transformer that is mapped to a class
if mapping is not present, this returns null.
|
int |
hashCode() |
NumberTransformer |
putTransformer(Class<?> key,
NumberTransformer transformer)
Sets a Class to Transformer Mapping in the Map.
|
NumberTransformer |
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<NumberTransformer> |
transformers()
Returns the Set of NumberTransformers used as values
in the map.
|
public TransformerMap()
public boolean containsClass(Class<?> key)
key
- Class to checkpublic boolean containsTransformer(NumberTransformer value)
value
- NumberTransformer to checkpublic NumberTransformer getTransformer(Class<?> key)
key
- The Class of the objectpublic NumberTransformer putTransformer(Class<?> key, NumberTransformer transformer)
key
- The Classtransformer
- The NumberTransformerpublic NumberTransformer removeTransformer(Class<?> key)
key
- The Classpublic void clear()
public Set<Class<?>> classes()
public Collection<NumberTransformer> transformers()
public double transform(Object o)
transform
in interface NumberTransformer
o
- the Object to be transformed.MathIllegalArgumentException
- if the Object can not be
transformed into a Double.NumberTransformer.transform(java.lang.Object)
Copyright © 2023 CNES. All rights reserved.