jklustor-all-api-0.0.7-20140619012755 (ChemAxon)


com.chemaxon.descriptors.common
Enum BinaryVectors.Endianness

Object
  extended by Enum<BinaryVectors.Endianness>
      extended by com.chemaxon.descriptors.common.BinaryVectors.Endianness
All Implemented Interfaces:
Serializable, Comparable<BinaryVectors.Endianness>
Enclosing class:
BinaryVectors

public static enum BinaryVectors.Endianness
extends Enum<BinaryVectors.Endianness>

Order of components in packed representations.

See Also:
http://en.wikipedia.org/wiki/Endianness

Enum Constant Summary
BIG_ENDIAN
          Decreasing numeric significance with increasing addresses/indices.
LITTLE_ENDIAN
          Increasing numeric significance with increasing addresses/indices.
 
Method Summary
abstract  void appendLongAsBinaryString(StringBuilder b, long l)
          Convert 64 bit long to binary string.
abstract  int packBytesToInt(byte[] buffer, int firstIndex)
          Pack four 8 bit bytes into a 32 bit int.
 int packBytesToInt(byte b0, byte b1, byte b2, byte b3)
          Pack four 8 bit bytes into a 32 bit int.
abstract  long packBytesToLong(byte[] buffer, int firstIndex)
          Pack eight 8 bit bytes into a 64 bit long.
 long packBytesToLong(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7)
          Pack eight 8 bit bytes into a 64 bit long.
abstract  long packIntsToLong(int i0, int i1)
          Pack two 32 bit integers into a 64 bit long.
abstract  long parseBinaryStringAsLong(String s)
          Parse a binary String as a 64 bit long.
 byte[] unpackBytesFromInt(int i)
          Unpack four 8 bit bytes from a 32 bit int.
abstract  void unpackBytesFromInt(int i, byte[] buffer, int firstIndex)
          Unpack four 8 bit bytes from a 32 bit int.
 byte[] unpackBytesFromLong(long l)
          Unpack eight 8 bit bytes from a 64 bit long.
abstract  void unpackBytesFromLong(long l, byte[] buffer, int firstIndex)
          Unpack eight 8 bit bytes from a 64 bit long.
abstract  int unpackInt0FromLong(long l)
          Unpack first 32 bit integer from a 64 bit long according to the represented endianness.
abstract  int unpackInt1FromLong(long l)
          Unpack second 32 bit integer from a 64 bit long according to the represented endianness.
static BinaryVectors.Endianness valueOf(String name)
          Returns the enum constant of this type with the specified name.
static BinaryVectors.Endianness[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BIG_ENDIAN

public static final BinaryVectors.Endianness BIG_ENDIAN
Decreasing numeric significance with increasing addresses/indices.

Most significant part first.


LITTLE_ENDIAN

public static final BinaryVectors.Endianness LITTLE_ENDIAN
Increasing numeric significance with increasing addresses/indices.

Least significant part first.

Method Detail

values

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

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

valueOf

public static BinaryVectors.Endianness 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

packIntsToLong

public abstract long packIntsToLong(int i0,
                                    int i1)
Pack two 32 bit integers into a 64 bit long.

Parameters:
i0 - First integer, associated with lower index/address
i1 - Second integer, associated with higher index/address
Returns:
Packed long

unpackInt0FromLong

public abstract int unpackInt0FromLong(long l)
Unpack first 32 bit integer from a 64 bit long according to the represented endianness.

Parameters:
l - Packed long
Returns:
Integer associated with the lower index/address

unpackInt1FromLong

public abstract int unpackInt1FromLong(long l)
Unpack second 32 bit integer from a 64 bit long according to the represented endianness.

Parameters:
l - Packed long
Returns:
Integer associated with the higher index/address

packBytesToLong

public long packBytesToLong(byte b0,
                            byte b1,
                            byte b2,
                            byte b3,
                            byte b4,
                            byte b5,
                            byte b6,
                            byte b7)
Pack eight 8 bit bytes into a 64 bit long.

Parameters:
b0 - First byte, associated with lowest index/address
b1 - Second byte
b2 - Third byte
b3 - Fourth byte
b4 - Fifth byte
b5 - Sixth byte
b6 - Seventh byte
b7 - Eighth byte, associated with the highest index/address
Returns:
Packed long

packBytesToInt

public int packBytesToInt(byte b0,
                          byte b1,
                          byte b2,
                          byte b3)
Pack four 8 bit bytes into a 32 bit int.

Parameters:
b0 - First byte, associated with lowest index/address
b1 - Second byte
b2 - Third byte
b3 - Fourth byte, associated with the highest index/address
Returns:
Packed int

packBytesToLong

public abstract long packBytesToLong(byte[] buffer,
                                     int firstIndex)
Pack eight 8 bit bytes into a 64 bit long.

Parameters:
buffer - Buffer containing bytes to pack
firstIndex - Index of the first byte to pack in the buffer
Returns:
Packed long; bytes from the given array; from given index to (including) given index + 7 are packed

packBytesToInt

public abstract int packBytesToInt(byte[] buffer,
                                   int firstIndex)
Pack four 8 bit bytes into a 32 bit int.

Parameters:
buffer - Buffer containing bytes to pack
firstIndex - Index of the first byte to pack in the buffer
Returns:
Packed int; bytes from the given array; from given index to (including) given index + 3 are packed

unpackBytesFromLong

public byte[] unpackBytesFromLong(long l)
Unpack eight 8 bit bytes from a 64 bit long.

Parameters:
l - Packed long
Returns:
Array of 8 bytes. Index 0 is associated with the lowest index/address.

unpackBytesFromInt

public byte[] unpackBytesFromInt(int i)
Unpack four 8 bit bytes from a 32 bit int.

Parameters:
i - Packed int
Returns:
Array of 4 bytes. Index 0 is associated with the lowest index/address.

unpackBytesFromLong

public abstract void unpackBytesFromLong(long l,
                                         byte[] buffer,
                                         int firstIndex)
Unpack eight 8 bit bytes from a 64 bit long.

Parameters:
l - Packed long
buffer - target buffer
firstIndex - Index of the first byte to write in the buffer (associated with the lowest index/address)

unpackBytesFromInt

public abstract void unpackBytesFromInt(int i,
                                        byte[] buffer,
                                        int firstIndex)
Unpack four 8 bit bytes from a 32 bit int.

Parameters:
i - Packed int
buffer - target buffer
firstIndex - Index of the first byte to write in the buffer (associated with the lowest index/address)

parseBinaryStringAsLong

public abstract long parseBinaryStringAsLong(String s)
Parse a binary String as a 64 bit long.

Parameters:
s - Binary String to parse
Returns:
parsef long
Throws:
IllegalArgumentException - when parameter String length differs from 64 or contains other than '0' and '1' characters

appendLongAsBinaryString

public abstract void appendLongAsBinaryString(StringBuilder b,
                                              long l)
Convert 64 bit long to binary string.

Parameters:
b - Target buffer to write to
l - Long to convert

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)