public class TransformerMap extends java.lang.Object implements NumberTransformer, java.io.Serializable
double transform(Object o)
method.Constructor and Description |
---|
TransformerMap()
Build a map containing only the default transformer.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Class<?>> |
classes()
Returns the Set of Classes used as keys in the map.
|
void |
clear()
Clears all the Class to Transformer mappings.
|
boolean |
containsClass(java.lang.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(java.lang.Object other) |
NumberTransformer |
getTransformer(java.lang.Class<?> key)
Returns the Transformer that is mapped to a class
if mapping is not present, this returns null.
|
int |
hashCode() |
NumberTransformer |
putTransformer(java.lang.Class<?> key,
NumberTransformer transformer)
Sets a Class to Transformer Mapping in the Map.
|
NumberTransformer |
removeTransformer(java.lang.Class<?> key)
Removes a Class to Transformer Mapping in the Map.
|
double |
transform(java.lang.Object o)
Attempts to transform the Object against the map of
NumberTransformers.
|
java.util.Collection<NumberTransformer> |
transformers()
Returns the Set of NumberTransformers used as values
in the map.
|
public TransformerMap()
public boolean containsClass(java.lang.Class<?> key)
key
- Class to checkpublic boolean containsTransformer(NumberTransformer value)
value
- NumberTransformer to checkpublic NumberTransformer getTransformer(java.lang.Class<?> key)
key
- The Class of the objectpublic NumberTransformer putTransformer(java.lang.Class<?> key, NumberTransformer transformer)
key
- The Classtransformer
- The NumberTransformerpublic NumberTransformer removeTransformer(java.lang.Class<?> key)
key
- The Classpublic void clear()
public java.util.Set<java.lang.Class<?>> classes()
public java.util.Collection<NumberTransformer> transformers()
public double transform(java.lang.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)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved