com.github.croesch.micro_debug.mic1.mem
Enum IJVMCommandArgument

java.lang.Object
  extended by java.lang.Enum<IJVMCommandArgument>
      extended by com.github.croesch.micro_debug.mic1.mem.IJVMCommandArgument
All Implemented Interfaces:
Serializable, Comparable<IJVMCommandArgument>

public enum IJVMCommandArgument
extends Enum<IJVMCommandArgument>

Argument that belongs to an IJVMCommand.

Since:
Date: Jan 22, 2012
Author:
croesch

Enum Constant Summary
BYTE
          represents a single byte
CONST
          represents a constant
INDEX
          represents an index
LABEL
          represents a label defined in the assembler code
OFFSET
          represents an offset
VARNUM
          represents a variable
 
Method Summary
 int getNumberOfBytes()
          Returns the number of bytes needed to build this argument.
 String getRepresentationOfArgument(int addr, int value, Memory mem)
          Returns the String representing the given value of this argument.
 String represent(int addr, int value, Memory mem)
          Returns the String representation of the given value that is expected to have the correct size.
static IJVMCommandArgument valueOf(String name)
          Returns the enum constant of this type with the specified name.
static IJVMCommandArgument[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BYTE

public static final IJVMCommandArgument BYTE
represents a single byte


LABEL

public static final IJVMCommandArgument LABEL
represents a label defined in the assembler code


CONST

public static final IJVMCommandArgument CONST
represents a constant


VARNUM

public static final IJVMCommandArgument VARNUM
represents a variable


OFFSET

public static final IJVMCommandArgument OFFSET
represents an offset


INDEX

public static final IJVMCommandArgument INDEX
represents an index

Method Detail

values

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

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

valueOf

public static IJVMCommandArgument 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

getNumberOfBytes

public final int getNumberOfBytes()
Returns the number of bytes needed to build this argument.

Returns:
number of bytes needed to build this argument
Since:
Date: Jan 23, 2012

getRepresentationOfArgument

public final String getRepresentationOfArgument(int addr,
                                                int value,
                                                Memory mem)
Returns the String representing the given value of this argument.

Parameters:
addr - the address of the command this argument belongs to
value - the value of the argument to represent as String
mem - the memory to fetch values from
Returns:
the String representing the given value for this argument.
Since:
Date: Jan 23, 2012

represent

public String represent(int addr,
                        int value,
                        Memory mem)
Returns the String representation of the given value that is expected to have the correct size. By default this will return the hexadecimal representation of the given number.

Parameters:
addr - the address of the command this argument belongs to
value - the number to represent
mem - the memory to fetch values from
Returns:
the string representation of the given value for that argument.
Since:
Date: Jan 23, 2012


Copyright © 2012. All Rights Reserved.