Package com.chemaxon.descriptors.common
Enum Class BinaryVectors.Endianness
- All Implemented Interfaces:
Serializable
,Comparable<BinaryVectors.Endianness>
,java.lang.constant.Constable
- Enclosing class:
- BinaryVectors
Order of components in packed representations.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDecreasing numeric significance with increasing addresses/indices.Increasing numeric significance with increasing addresses/indices. -
Method Summary
Modifier and TypeMethodDescriptionabstract 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 int
packIntIntoBitSet
(int i, BitSet b, int start) Pack an int value into a BitSet.abstract long
packIntsToLong
(int i0, int i1) Pack two 32 bit integers into a 64 bit long.abstract int
packLongIntoBitSet
(long l, BitSet b, int start) Pack a long value into a BitSet.abstract long
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.abstract int
unpackIntFromBitSet
(BitSet b, int start) Unpack an int value from a BitSet.abstract long
unpackLongFromBitSet
(BitSet b, int start) Unpack a long value from a BitSet.static BinaryVectors.Endianness
Returns the enum constant of this class with the specified name.static BinaryVectors.Endianness[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BIG_ENDIAN
Decreasing numeric significance with increasing addresses/indices.Most significant part first.
-
LITTLE_ENDIAN
Increasing numeric significance with increasing addresses/indices.Least significant part first.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- 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/addressi1
- 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/addressb1
- Second byteb2
- Third byteb3
- Fourth byteb4
- Fifth byteb5
- Sixth byteb6
- Seventh byteb7
- 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/addressb1
- Second byteb2
- Third byteb3
- 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 packfirstIndex
- 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 packfirstIndex
- 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 longbuffer
- target bufferfirstIndex
- 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 intbuffer
- target bufferfirstIndex
- Index of the first byte to write in the buffer (associated with the lowest index/address)
-
parseBinaryStringAsLong
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
Convert 64 bit long to binary string.- Parameters:
b
- Target buffer to write tol
- Long to convert
-
unpackIntFromBitSet
Unpack an int value from a BitSet.- Parameters:
b
- Source BitSet.start
- Position of first bit to read in the BitSet- Returns:
- Unpacked int.
-
unpackLongFromBitSet
Unpack a long value from a BitSet.- Parameters:
b
- Source BitSet.start
- Position of first bit to read in the BitSet- Returns:
- Unpacked long.
-
packIntIntoBitSet
Pack an int value into a BitSet.- Parameters:
i
- Value to packb
- Target BitSetstart
- Position of the first bit to write- Returns:
- Position of first bit to write by a subsequent pack
-
packLongIntoBitSet
Pack a long value into a BitSet.- Parameters:
l
- Value to packb
- Target BitSetstart
- Position of the first bit to write- Returns:
- Position of first bit to write by a subsequent pack
-