org.zmpp.vm
Class Operand

java.lang.Object
  extended by org.zmpp.vm.Operand

public class Operand
extends Object

This is the definition of an instruction's operand. Each operand has an operand type, and a value which is to be interpreted according to the type.

Version:
1.0
Author:
Wei-ju Wu

Nested Class Summary
static class Operand.OperandType
          The available operand types.
 
Field Summary
static byte TYPENUM_LARGE_CONSTANT
          Type number for a large constant.
static byte TYPENUM_OMITTED
          Type number for omitted.
static byte TYPENUM_SMALL_CONSTANT
          Type number for a small constant.
static byte TYPENUM_VARIABLE
          Type number for a variable.
 
Constructor Summary
Operand(int typenum, short value)
          Constructor.
 
Method Summary
 Operand.OperandType getType()
          Returns this operand's type.
 short getValue()
          The operand value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPENUM_LARGE_CONSTANT

public static final byte TYPENUM_LARGE_CONSTANT
Type number for a large constant.

See Also:
Constant Field Values

TYPENUM_SMALL_CONSTANT

public static final byte TYPENUM_SMALL_CONSTANT
Type number for a small constant.

See Also:
Constant Field Values

TYPENUM_VARIABLE

public static final byte TYPENUM_VARIABLE
Type number for a variable.

See Also:
Constant Field Values

TYPENUM_OMITTED

public static final byte TYPENUM_OMITTED
Type number for omitted.

See Also:
Constant Field Values
Constructor Detail

Operand

public Operand(int typenum,
               short value)
Constructor.

Parameters:
typenum - the type number, must be < 4
value - the operand value
Method Detail

getType

public Operand.OperandType getType()
Returns this operand's type.

Returns:
the operand type

getValue

public short getValue()
The operand value.

Returns:
the value


Copyright © 2005 . All Rights Reserved.