Package: org.codehaus.groovy.reflection.stdclasses

## [Java] Class NumberCachedClass

- org.codehaus.groovy.reflection.stdclasses.NumberCachedClass

-     public class NumberCachedClass
      extends CachedClass

  Base class for optimized reflection caching of numeric types. Provides common type coercion logic for primitive and boxed numeric types, as well as BigInteger and BigDecimal.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class CachedClass` | `EMPTY_ARRAY, classInfo, isArray, isInterface, isNumber, isPrimitive, modifiers, mopMethods`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `NumberCachedClass(Class klazz, ClassInfo classInfo)` Constructs a cached class representation for a numeric class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `coerceArgument(Object argument)` Coerces the given argument if it is a Number.
    `` | `public boolean` | `isAssignableFrom(Class classToTransformFrom)` Determines if the given class can be transformed to this numeric type.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CachedClass` | `addNewMopMethods, coerceArgument, getCachedClass, getCachedSuperClass, getConstructors, getDeclaredInterfaces, getFields, getHierarchy, getInterfaces, getMethods, getModifiers, getName, getNewMetaMethods, getSuperClassDistance, getTheClass, getTypeDescription, hashCode, isAssignableFrom, isDirectlyAssignable, isInterface, isPrimitive, isVoid, searchMethods, setNewMopMethods, toString`

- - ### Constructor Detail

    - #### public NumberCachedClass(Class klazz, ClassInfo classInfo)

      Constructs a cached class representation for a numeric class.

      Parameters:
        `klazz` - the numeric class to cache
        `classInfo` - the class information associated with this cached class

  - ### Method Detail

    - #### public Object coerceArgument(Object argument)

      Coerces the given argument if it is a Number. Delegates to coerceNumber for specialized conversion logic.

      Parameters:
        `argument` - the argument to coerce
      Returns:
        the coerced number or the original argument if not a Number

    - #### public boolean isAssignableFrom(Class classToTransformFrom)

      Determines if the given class can be transformed to this numeric type. Accepts `null`, Number subclasses, and primitive numeric types.

      Parameters:
        `classToTransformFrom` - the source class to check
      Returns:
        `true` if the class can be transformed to this numeric type, `false` otherwise