com.github.croesch.micro_debug.commons
Enum Parameter

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

public enum Parameter
extends Enum<Parameter>

Represents the different types of parameter that are possible.

Since:
Date: Dec 3, 2011
Author:
croesch

Enum Constant Summary
NUMBER
          the numerical argument, can be decimal or every other basis
REGISTER
          a Register as argument
 
Method Summary
 Object getValue(String str)
          Converts the given String to an object that has the expected type.
protected abstract  Object toValue(String str)
          Converts the given String to an object that has the expected type.
static Parameter valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Parameter[] 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

NUMBER

public static final Parameter NUMBER
the numerical argument, can be decimal or every other basis


REGISTER

public static final Parameter REGISTER
a Register as argument

Method Detail

values

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

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

valueOf

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

toValue

protected abstract Object toValue(String str)
Converts the given String to an object that has the expected type. Returns an object with the logical type of the enumeration that has the given value. Returns null, if the given string is not a valid value.
Informs the user (per Printer) about a wrong value.

Parameters:
str - the value to convert into the correct data type, is not null
Returns:
an Object with the logical type of the enumeration that has the value given by the given string,
or null if the given String is no valid representation for any value of the data type
Since:
Date: Dec 3, 2011

getValue

public final Object getValue(String str)
Converts the given String to an object that has the expected type. Returns an object with the logical type of the enumeration that has the given value. Returns null, if the given string is not a valid value.

Parameters:
str - the value to convert into the correct data type, can be null
Returns:
an Object with the logical type of the enumeration that has the value given by the given string,
or null if the given String is no valid representation for any value of the data type
Since:
Date: Dec 3, 2011


Copyright © 2012. All Rights Reserved.