com.espertech.esper.util
Class SimpleTypeCasterAnyType

java.lang.Object
  extended by com.espertech.esper.util.SimpleTypeCasterAnyType
All Implemented Interfaces:
SimpleTypeCaster

public class SimpleTypeCasterAnyType
extends java.lang.Object
implements SimpleTypeCaster

Cast implementation for non-numeric values that caches allowed casts assuming there is a small set of casts allowed.


Constructor Summary
SimpleTypeCasterAnyType(java.lang.Class typeToCastTo)
          Ctor.
 
Method Summary
 java.lang.Object cast(java.lang.Object object)
          Casts an object to another type, typically for numeric types.
 boolean isNumericCast()
          Returns true to indicate that the cast target type is numeric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTypeCasterAnyType

public SimpleTypeCasterAnyType(java.lang.Class typeToCastTo)
Ctor.

Parameters:
typeToCastTo - is the target type
Method Detail

isNumericCast

public boolean isNumericCast()
Description copied from interface: SimpleTypeCaster
Returns true to indicate that the cast target type is numeric.

Specified by:
isNumericCast in interface SimpleTypeCaster
Returns:
true for numeric cast

cast

public java.lang.Object cast(java.lang.Object object)
Description copied from interface: SimpleTypeCaster
Casts an object to another type, typically for numeric types.

May performs a compatibility check and returns null if not compatible.

Specified by:
cast in interface SimpleTypeCaster
Parameters:
object - to cast
Returns:
casted or transformed object, possibly the same, or null if the cast cannot be made

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com