Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.util.Bits Class Reference

List of all members.

Static Public Member Functions

static int encodeAsInt (short high, short low)
static short decodeHighBits (int i)
static short decodeLowBits (int i)
static long encodeAsLong (int high, int low)
static int decodeHighBits (long l)
static int decodeLowBits (long l)

Detailed Description

Utility class for bit twiddling.

Author:
Lane Schwartz

Member Function Documentation

static short joshua.util.Bits.decodeHighBits ( int  i) [static]

Decodes the high 16 bits of an integer as a short.

Parameters:
iInteger value to decode
Returns:
Short representation of the high 16 bits of the integer
static int joshua.util.Bits.decodeHighBits ( long  l) [static]

Decodes the high 32 bits of a long as an integer.

Parameters:
lLong value to decode
Returns:
Integer representation of the high 32 bits of the long
static short joshua.util.Bits.decodeLowBits ( int  i) [static]

Decodes the low 16 bits of an integer as a short.

Parameters:
iInteger value to decode
Returns:
Short representation of the high 16 bits of the integer
static int joshua.util.Bits.decodeLowBits ( long  l) [static]

Decodes the low 32 bits of a long as an integer.

Parameters:
lLong value to decode
Returns:
Integer representation of the high 32 bits of the long
static int joshua.util.Bits.encodeAsInt ( short  high,
short  low 
) [static]

Encodes two shorts in an int.

Parameters:
high
low
Returns:
static long joshua.util.Bits.encodeAsLong ( int  high,
int  low 
) [static]

Encodes two integers in a long.

Parameters:
high
low
Returns: