com.amazon.carbonado.util
Class ConversionComparator
java.lang.Object
com.amazon.carbonado.util.ConversionComparator
- All Implemented Interfaces:
- Comparator<Class>
public class ConversionComparator
- extends Object
- implements Comparator<Class>
Compares type conversions, finding the one that is nearest.
- Since:
- 1.2
- Author:
- Brian S O'Neill
|
Method Summary |
int |
compare(Class toType_a,
Class toType_b)
Evaluates two types, to see which one is nearest to the from type. |
boolean |
isConversionPossible(Class toType)
Returns true if a coversion is possible to the given type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConversionComparator
public ConversionComparator(Class fromType)
isConversionPossible
public boolean isConversionPossible(Class toType)
- Returns true if a coversion is possible to the given type.
compare
public int compare(Class toType_a,
Class toType_b)
- Evaluates two types, to see which one is nearest to the from type.
Return <0 if "a" is nearest, 0 if both are equally good,
>0 if "b" is nearest.
- Specified by:
compare in interface Comparator<Class>
Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.