net.sf.ivmaidns.util
Class JavaConsts

java.lang.Object
  extended by net.sf.ivmaidns.util.JavaConsts

public final class JavaConsts
extends java.lang.Object

Class defining Java-specific constants. This class contains such the specific fundamental constants of Java platform (defined by 'The Java Language Specification') as the sizes, masks and limits for all Java numeric primitive types.

Since:
1.8
Version:
2.0
Author:
Ivan Maidanski
See Also:
UnsignedInt, UnsignedLong, PseudoRandom, ByteVector, CharVector, DoubleVector, FloatVector, IntVector, LongVector, ShortVector

Field Summary
static int BYTE_MASK
          The unsigned int mask of byte type.
static int BYTE_SIZE
          The size of byte primitive type in bits.
static int CHAR_LENGTH
          The length of char primitive type (in bytes).
static int CHAR_MASK
          The unsigned int mask of char type.
static int CHAR_SIZE
          The size of char primitive type in bits.
static long DOUBLE_EXP_MASK
          The unsigned long mask of the exponent part of double type.
static int DOUBLE_EXP_SIZE
          The size of exponent of double primitive type in bits.
static long DOUBLE_M_MASK
          The unsigned long mask of the mantissa part of double type.
static int DOUBLE_M_SIZE
          The size of mantissa of double primitive type in bits.
static int FLOAT_EXP_MASK
          The unsigned int mask of the exponent part of float type.
static int FLOAT_EXP_SIZE
          The size of exponent of float primitive type in bits.
static int FLOAT_M_MASK
          The unsigned int mask of the mantissa part of float type.
static int FLOAT_M_SIZE
          The size of mantissa of float primitive type in bits.
static int GOLD_MEDIAN
          Unsigned 'Gold Median' constant.
static int INT_LENGTH
          The length of int primitive type (in bytes).
static long INT_LMASK
          The unsigned long mask of int type.
static int INT_SIZE
          The size of int primitive type in bits.
static long LONG_GOLD_MEDIAN
          Unsigned 'Gold Median' constant for long type.
static int LONG_LENGTH
          The length of long primitive type (in bytes).
static int LONG_SIZE
          The size of long primitive type in bits.
static int MAX_BYTE
          The largest byte value.
static int MAX_INT
          The largest int value.
static long MAX_LONG
          The largest long value.
static int MAX_SHORT
          The largest short value.
static int MIN_BYTE
          The smallest byte value.
static int MIN_INT
          The smallest int value.
static long MIN_LONG
          The smallest long value.
static int MIN_SHORT
          The smallest short value.
static int SHORT_LENGTH
          The length of short primitive type (in bytes).
static int SHORT_MASK
          The unsigned int mask of short type.
static int SHORT_SIZE
          The size of short primitive type in bits.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_SIZE

public static final int BYTE_SIZE
The size of byte primitive type in bits. This is a fundamental constant of Java (8 by the standard). Its value is the same as the result of execution of value = 1; do { size++; } while ((value *= 2) != 0); statement, where value is of byte type.

See Also:
BYTE_MASK, MIN_BYTE, MAX_BYTE, CHAR_SIZE, SHORT_SIZE, INT_SIZE, LONG_SIZE, Constant Field Values

CHAR_SIZE

public static final int CHAR_SIZE
The size of char primitive type in bits. This is a fundamental constant of Java (16 by the standard). Its value is the same as the result of execution of value = 1; do { size++; } while ((value *= 2) != 0); statement, where value is of char type. Important notes: this size is not less than BYTE_SIZE; see also the Unicode standard.

See Also:
CHAR_LENGTH, CHAR_MASK, BYTE_SIZE, SHORT_SIZE, INT_SIZE, LONG_SIZE, Constant Field Values

SHORT_SIZE

public static final int SHORT_SIZE
The size of short primitive type in bits. This is a fundamental constant of Java (16 by the standard). Its value is the same as the result of execution of value = 1; do { size++; } while ((value *= 2) != 0); statement, where value is of short type. Important notes: this size is not less than BYTE_SIZE.

See Also:
SHORT_LENGTH, SHORT_MASK, MIN_SHORT, MAX_SHORT, BYTE_SIZE, CHAR_SIZE, INT_SIZE, LONG_SIZE, Constant Field Values

FLOAT_M_SIZE

public static final int FLOAT_M_SIZE
The size of mantissa of float primitive type in bits. This is a fundamental constant of Java (23 by the standard). Its value is the same as the result of execution of value = 1; while ((value *= 2) + 1 != value) size++; statement, where value is of float type. Important notes: this size is less than INT_SIZE; the whole size of float type is the same as the size of int type.

See Also:
FLOAT_M_MASK, FLOAT_EXP_SIZE, DOUBLE_M_SIZE, INT_SIZE, Constant Field Values

INT_SIZE

public static final int INT_SIZE
The size of int primitive type in bits. This is a fundamental constant of Java (32 by the standard). Its value is the same as the result of execution of value = 1; do { size++; } while ((value *= 2) != 0); statement, where value is of int type. Important notes: this size is not less than SHORT_SIZE.

See Also:
INT_LENGTH, INT_LMASK, MIN_INT, MAX_INT, BYTE_SIZE, CHAR_SIZE, SHORT_SIZE, LONG_SIZE, FLOAT_M_SIZE, Constant Field Values

DOUBLE_M_SIZE

public static final int DOUBLE_M_SIZE
The size of mantissa of double primitive type in bits. This is a fundamental constant of Java (52 by the standard). Its value is the same as the result of execution of value = 1; while ((value *= 2) + 1 != value) size++; statement, where value is of double type. Important notes: this size is less than LONG_SIZE and not less than FLOAT_M_SIZE; the whole size of double type is the same as the size of long.

See Also:
DOUBLE_M_MASK, DOUBLE_EXP_SIZE, FLOAT_M_SIZE, LONG_SIZE, Constant Field Values

LONG_SIZE

public static final int LONG_SIZE
The size of long primitive type in bits. This is a fundamental constant of Java (64 by the standard). Its value is the same as the result of execution of value = 1; do { size++; } while ((value *= 2) != 0); statement, where value is of long type. Important notes: this size is not less than INT_SIZE.

See Also:
LONG_LENGTH, MIN_LONG, MAX_LONG, BYTE_SIZE, SHORT_SIZE, INT_SIZE, DOUBLE_M_SIZE, Constant Field Values

GOLD_MEDIAN

public static final int GOLD_MEDIAN
Unsigned 'Gold Median' constant. This constant is the calculated integer value of (sqrt(5) - 1) * (MAX_INT + 1) rounded to the nearest prime. 'Gold Median' is used for various digest calculations ('Multiplicative' method) as follows: (((value ^ seed) * GOLD_MEDIAN) >>> shift), where shift is equal to (INT_SIZE - resultSize).

See Also:
LONG_GOLD_MEDIAN, INT_SIZE, INT_LMASK, MAX_INT, Constant Field Values

LONG_GOLD_MEDIAN

public static final long LONG_GOLD_MEDIAN
Unsigned 'Gold Median' constant for long type. This constant is the calculated long integer value of (sqrt(5) - 1) * (MAX_LONG + 1) rounded to the nearest prime. 'Gold Median' is used for various digest calculations ('Multiplicative' method) as follows: (((value ^ seed) * LONG_GOLD_MEDIAN) >>> shift), where shift is equal to (LONG_SIZE - resultSize).

See Also:
GOLD_MEDIAN, LONG_SIZE, MAX_LONG, Constant Field Values

FLOAT_EXP_SIZE

public static final int FLOAT_EXP_SIZE
The size of exponent of float primitive type in bits.

See Also:
FLOAT_EXP_MASK, FLOAT_M_SIZE, DOUBLE_EXP_SIZE, INT_SIZE, Constant Field Values

DOUBLE_EXP_SIZE

public static final int DOUBLE_EXP_SIZE
The size of exponent of double primitive type in bits.

See Also:
DOUBLE_EXP_MASK, DOUBLE_M_SIZE, FLOAT_EXP_SIZE, LONG_SIZE, Constant Field Values

CHAR_LENGTH

public static final int CHAR_LENGTH
The length of char primitive type (in bytes).

See Also:
CHAR_SIZE, CHAR_MASK, SHORT_LENGTH, INT_LENGTH, LONG_LENGTH, Constant Field Values

SHORT_LENGTH

public static final int SHORT_LENGTH
The length of short primitive type (in bytes).

See Also:
SHORT_SIZE, SHORT_MASK, MIN_SHORT, MAX_SHORT, CHAR_LENGTH, INT_LENGTH, LONG_LENGTH, Constant Field Values

INT_LENGTH

public static final int INT_LENGTH
The length of int primitive type (in bytes).

See Also:
INT_SIZE, INT_LMASK, MIN_INT, MAX_INT, CHAR_LENGTH, SHORT_LENGTH, LONG_LENGTH, Constant Field Values

LONG_LENGTH

public static final int LONG_LENGTH
The length of long primitive type (in bytes).

See Also:
LONG_SIZE, MIN_LONG, MAX_LONG, CHAR_LENGTH, SHORT_LENGTH, INT_LENGTH, Constant Field Values

BYTE_MASK

public static final int BYTE_MASK
The unsigned int mask of byte type.

See Also:
BYTE_SIZE, MIN_BYTE, MAX_BYTE, CHAR_MASK, SHORT_MASK, INT_LMASK, Constant Field Values

CHAR_MASK

public static final int CHAR_MASK
The unsigned int mask of char type.

See Also:
CHAR_SIZE, CHAR_LENGTH, BYTE_MASK, SHORT_MASK, INT_LMASK, Constant Field Values

SHORT_MASK

public static final int SHORT_MASK
The unsigned int mask of short type.

See Also:
SHORT_SIZE, SHORT_LENGTH, MIN_SHORT, MAX_SHORT, BYTE_MASK, CHAR_MASK, INT_LMASK, Constant Field Values

INT_LMASK

public static final long INT_LMASK
The unsigned long mask of int type.

See Also:
INT_SIZE, INT_LENGTH, MIN_INT, MAX_INT, BYTE_MASK, CHAR_MASK, SHORT_MASK, FLOAT_M_MASK, FLOAT_EXP_MASK, Constant Field Values

FLOAT_M_MASK

public static final int FLOAT_M_MASK
The unsigned int mask of the mantissa part of float type.

See Also:
FLOAT_M_SIZE, FLOAT_EXP_MASK, DOUBLE_M_MASK, INT_SIZE, INT_LENGTH, INT_LMASK, Constant Field Values

FLOAT_EXP_MASK

public static final int FLOAT_EXP_MASK
The unsigned int mask of the exponent part of float type.

See Also:
FLOAT_EXP_SIZE, FLOAT_M_MASK, DOUBLE_EXP_MASK, INT_SIZE, INT_LENGTH, INT_LMASK, Constant Field Values

DOUBLE_M_MASK

public static final long DOUBLE_M_MASK
The unsigned long mask of the mantissa part of double type.

See Also:
DOUBLE_M_SIZE, DOUBLE_EXP_MASK, FLOAT_M_MASK, LONG_SIZE, LONG_LENGTH, Constant Field Values

DOUBLE_EXP_MASK

public static final long DOUBLE_EXP_MASK
The unsigned long mask of the exponent part of double type.

See Also:
DOUBLE_EXP_SIZE, DOUBLE_M_MASK, FLOAT_EXP_MASK, LONG_SIZE, LONG_LENGTH, Constant Field Values

MIN_BYTE

public static final int MIN_BYTE
The smallest byte value.

See Also:
BYTE_SIZE, BYTE_MASK, MAX_BYTE, MIN_SHORT, MIN_INT, MIN_LONG, Constant Field Values

MAX_BYTE

public static final int MAX_BYTE
The largest byte value.

See Also:
BYTE_SIZE, BYTE_MASK, MIN_BYTE, MAX_SHORT, MAX_INT, MAX_LONG, Constant Field Values

MIN_SHORT

public static final int MIN_SHORT
The smallest short value.

See Also:
SHORT_SIZE, SHORT_LENGTH, SHORT_MASK, MAX_SHORT, MIN_BYTE, MIN_INT, MIN_LONG, Constant Field Values

MAX_SHORT

public static final int MAX_SHORT
The largest short value.

See Also:
SHORT_SIZE, SHORT_LENGTH, SHORT_MASK, MIN_SHORT, MAX_BYTE, MAX_INT, MAX_LONG, Constant Field Values

MIN_INT

public static final int MIN_INT
The smallest int value.

See Also:
INT_SIZE, INT_LENGTH, INT_LMASK, MAX_INT, MIN_BYTE, MIN_SHORT, MIN_LONG, Constant Field Values

MAX_INT

public static final int MAX_INT
The largest int value.

See Also:
INT_SIZE, INT_LENGTH, INT_LMASK, MIN_INT, MAX_BYTE, MAX_SHORT, MAX_LONG, Constant Field Values

MIN_LONG

public static final long MIN_LONG
The smallest long value.

See Also:
LONG_SIZE, LONG_LENGTH, MAX_LONG, MIN_BYTE, MIN_SHORT, MIN_INT, Constant Field Values

MAX_LONG

public static final long MAX_LONG
The largest long value.

See Also:
LONG_SIZE, LONG_LENGTH, MIN_LONG, MAX_BYTE, MAX_SHORT, MAX_INT, Constant Field Values