org.scijava.util
Class NumberUtils

java.lang.Object
  extended by org.scijava.util.NumberUtils

public final class NumberUtils
extends Object

Useful methods for working with Number objects.

Author:
Curtis Rueden, Barry DeZonia

Method Summary
static Number clampToRange(Class<?> type, Number value, Number min, Number max)
           
static Number getDefaultValue(Number min, Number max, Class<?> type)
           
static Number getMaximumNumber(Class<?> type)
           
static Number getMinimumNumber(Class<?> type)
           
static Number toNumber(Object value, Class<?> type)
          Converts the given object to a Number of the specified type, or null if the types are incompatible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toNumber

public static Number toNumber(Object value,
                              Class<?> type)
Converts the given object to a Number of the specified type, or null if the types are incompatible.


getMinimumNumber

public static Number getMinimumNumber(Class<?> type)

getMaximumNumber

public static Number getMaximumNumber(Class<?> type)

getDefaultValue

public static Number getDefaultValue(Number min,
                                     Number max,
                                     Class<?> type)

clampToRange

public static Number clampToRange(Class<?> type,
                                  Number value,
                                  Number min,
                                  Number max)


Copyright © 2009–2014 SciJava. All rights reserved.