Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.util.encoding.PrimitiveIntEncoder Enum Reference
Inheritance diagram for joshua.util.encoding.PrimitiveIntEncoder:
[legend]
Collaboration diagram for joshua.util.encoding.PrimitiveIntEncoder:
[legend]

List of all members.

Public Member Functions

String getKey ()
int size ()
void readState (DataInputStream in) throws IOException
void writeState (DataOutputStream out) throws IOException
abstract int read (ByteBuffer stream, int position)
abstract void write (ByteBuffer stream, int value)

Static Public Member Functions

static PrimitiveIntEncoder get (String k)

Public Attributes

 BYTE
 CHAR
 INT
 SHORT

Private Member Functions

 PrimitiveIntEncoder (String k, int s)

Private Attributes

final String key
final int size

Constructor & Destructor Documentation


Member Function Documentation

Here is the caller graph for this function:

abstract int joshua.util.encoding.PrimitiveIntEncoder.read ( ByteBuffer  stream,
int  position 
) [pure virtual]
void joshua.util.encoding.PrimitiveIntEncoder.readState ( DataInputStream  in) throws IOException
abstract void joshua.util.encoding.PrimitiveIntEncoder.write ( ByteBuffer  stream,
int  value 
) [pure virtual]
void joshua.util.encoding.PrimitiveIntEncoder.writeState ( DataOutputStream  out) throws IOException

Member Data Documentation

Initial value:
("byte", 1) {
    public final int read(ByteBuffer stream, int position) {
      return (int) stream.get(position);
    }

    public final void write(ByteBuffer stream, int value) {
      stream.put((byte) value);
    }
  }
Initial value:
("char", 2) {
    public final int read(ByteBuffer stream, int position) {
      return (int) stream.getChar(position);
    }

    public final void write(ByteBuffer stream, int value) {
      stream.putChar((char) value);
    }
  }
Initial value:
("int", 4) {
    public final int read(ByteBuffer stream, int position) {
      return (int) stream.getInt(position);
    }

    public final void write(ByteBuffer stream, int value) {
      stream.putInt((int) value);
    }
  }
Initial value:
("short", 2) {
    public final int read(ByteBuffer stream, int position) {
      return (int) stream.getShort(position);
    }

    public final void write(ByteBuffer stream, int value) {
      stream.putShort((short) value);
    }
  }