org.jnetpcap.nio
Enum JNumber.Type

java.lang.Object
  extended by java.lang.Enum<JNumber.Type>
      extended by org.jnetpcap.nio.JNumber.Type
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<JNumber.Type>
Enclosing class:
JNumber

public static enum JNumber.Type
extends java.lang.Enum<JNumber.Type>

Used to request a specific type of primitive that this number will be dealing with possibly allocating memory more efficiently to fit the primitive type.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
BYTE
          8-bit integer.
CHAR
          16-bit UTF character.
DOUBLE
          A long floating point value.
FLOAT
          A floating point value.
INT
          32-bit integer.
LONG
          64-bit integer.
SHORT
          16-bit integer.
 
Field Summary
 int size
          Size in bytes for this native type on this machine.
 
Method Summary
static int getBiggestSize()
          Returns the size of the biggets primitive.
static JNumber.Type valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static JNumber.Type[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BYTE

public static final JNumber.Type BYTE
8-bit integer.


CHAR

public static final JNumber.Type CHAR
16-bit UTF character.


INT

public static final JNumber.Type INT
32-bit integer.


SHORT

public static final JNumber.Type SHORT
16-bit integer.


LONG

public static final JNumber.Type LONG
64-bit integer.


FLOAT

public static final JNumber.Type FLOAT
A floating point value.


DOUBLE

public static final JNumber.Type DOUBLE
A long floating point value.

Field Detail

size

public final int size
Size in bytes for this native type on this machine.

Method Detail

values

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

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

valueOf

public static JNumber.Type valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getBiggestSize

public static int getBiggestSize()
Returns the size of the biggets primitive.

Returns:
size in bytes of the biggest primitive on this platform