edu.ucla.belief.approx
Enum Macros.Doubler

Object
  extended by Enum<Macros.Doubler>
      extended by Macros.Doubler
All Implemented Interfaces:
Serializable, Comparable<Macros.Doubler>
Enclosing class:
Macros

public static enum Macros.Doubler
extends Enum<Macros.Doubler>

Convert arrays with various component types to individual primitive double values.

Since:
20080220
Author:
keith cascio

Enum Constant Summary
BOOLEAN
          boolean[]
BYTE
          byte[]
CHAR
          char[]
DOUBLE
          double[]
FLOAT
          float[]
INT
          int[]
LONG
          long[]
NUMBER
          AtomicInteger[] | AtomicLong[] | BigDecimal[] | BigInteger[] | Byte[] | Double[] | Float[] | Integer[] | Long[] | Short[]
SHORT
          short[]
STRING
          String[] and any other component type where toString() can be passed to Double.parseDouble().
 
Field Summary
 Class<?> clazz
          A particular Doubler is designed to convert arrays with component type assignable from this type.
 
Method Summary
static Macros.Doubler forArray(Object array)
          Choose the appropriate Doubler for the specified array.
 double get(Object array, int index)
          Convert the element of the specified array at the specified index to a primitive double value.
static Macros.Doubler valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Macros.Doubler[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BOOLEAN

public static final Macros.Doubler BOOLEAN
boolean[]


BYTE

public static final Macros.Doubler BYTE
byte[]


CHAR

public static final Macros.Doubler CHAR
char[]


DOUBLE

public static final Macros.Doubler DOUBLE
double[]


FLOAT

public static final Macros.Doubler FLOAT
float[]


INT

public static final Macros.Doubler INT
int[]


LONG

public static final Macros.Doubler LONG
long[]


SHORT

public static final Macros.Doubler SHORT
short[]


NUMBER

public static final Macros.Doubler NUMBER
AtomicInteger[] | AtomicLong[] | BigDecimal[] | BigInteger[] | Byte[] | Double[] | Float[] | Integer[] | Long[] | Short[]


STRING

public static final Macros.Doubler STRING
String[] and any other component type where toString() can be passed to Double.parseDouble().

Field Detail

clazz

public final Class<?> clazz
A particular Doubler is designed to convert arrays with component type assignable from this type.

Method Detail

values

public static Macros.Doubler[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Macros.Doubler c : Macros.Doubler.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Macros.Doubler valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

forArray

public static Macros.Doubler forArray(Object array)
Choose the appropriate Doubler for the specified array.


get

public double get(Object array,
                  int index)
Convert the element of the specified array at the specified index to a primitive double value.



Copyright 2010 UCLA Automated Reasoning Group