org.jaitools.numeric
Enum NumberOperations.ClassInfo

java.lang.Object
  extended by java.lang.Enum<NumberOperations.ClassInfo>
      extended by org.jaitools.numeric.NumberOperations.ClassInfo
All Implemented Interfaces:
Serializable, Comparable<NumberOperations.ClassInfo>
Enclosing class:
NumberOperations

public static enum NumberOperations.ClassInfo
extends Enum<NumberOperations.ClassInfo>

Information about the Number classes supported including their rank in terms of numeric precision.


Enum Constant Summary
BYTE
          Byte: rank 0, integral type
DOUBLE
          Double: rank 5, non-integral type
FLOAT
          Float: rank 4, non-integral type
INTEGER
          Integer: rank 2, integral type
LONG
          Long: rank 3, integral type
SHORT
          Short: rank 1, integral type
 
Method Summary
static NumberOperations.ClassInfo get(Class<? extends Number> clazz)
          Gets the ClassInfo type for the given class
 Class<? extends Number> getNumberClass()
          Gets the class that this type relates to
 int getRank()
          Gets the relative rank of this type in terms of numeric precision.
 boolean isIntegral()
          Tests if this is an integral type
 String toString()
          Gets a String representation of this type
static NumberOperations.ClassInfo valueOf(String name)
          Returns the enum constant of this type with the specified name.
static NumberOperations.ClassInfo[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BYTE

public static final NumberOperations.ClassInfo BYTE
Byte: rank 0, integral type


SHORT

public static final NumberOperations.ClassInfo SHORT
Short: rank 1, integral type


INTEGER

public static final NumberOperations.ClassInfo INTEGER
Integer: rank 2, integral type


LONG

public static final NumberOperations.ClassInfo LONG
Long: rank 3, integral type


FLOAT

public static final NumberOperations.ClassInfo FLOAT
Float: rank 4, non-integral type


DOUBLE

public static final NumberOperations.ClassInfo DOUBLE
Double: rank 5, non-integral type

Method Detail

values

public static NumberOperations.ClassInfo[] 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 (NumberOperations.ClassInfo c : NumberOperations.ClassInfo.values())
    System.out.println(c);

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

valueOf

public static NumberOperations.ClassInfo 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

getRank

public int getRank()
Gets the relative rank of this type in terms of numeric precision.

Returns:
int value for rank

getNumberClass

public Class<? extends Number> getNumberClass()
Gets the class that this type relates to

Returns:
the class

isIntegral

public boolean isIntegral()
Tests if this is an integral type

Returns:
true if integral; false otherwise

toString

public String toString()
Gets a String representation of this type

Overrides:
toString in class Enum<NumberOperations.ClassInfo>
Returns:
a String of the form "ClassInfo<classname>"

get

public static NumberOperations.ClassInfo get(Class<? extends Number> clazz)
Gets the ClassInfo type for the given class

Parameters:
clazz - a Number class
Returns:
the ClassInfo type or null if the class is not recognized


Copyright © 2009-2013. All Rights Reserved.