cdx.scorebot.scoring.logic
Enum LiteralType

java.lang.Object
  extended by java.lang.Enum<LiteralType>
      extended by cdx.scorebot.scoring.logic.LiteralType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LiteralType>

public enum LiteralType
extends java.lang.Enum<LiteralType>

defines the different kinds of types which can be used in the logic

Author:
David Underhill

Enum Constant Summary
BOOLEAN
           
DOUBLE
           
INTEGER
           
STRING
           
 
Method Summary
 Literal getDefaultValue()
          Returns false if this is a Boolean, 0 if this is an Integer, 0.0 if this is a Double, and the empty string if this is a String.
 java.lang.String toString()
          returns bool, fp, int, or string as appropriate
static LiteralType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static LiteralType[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BOOLEAN

public static final LiteralType BOOLEAN

DOUBLE

public static final LiteralType DOUBLE

INTEGER

public static final LiteralType INTEGER

STRING

public static final LiteralType STRING
Method Detail

values

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

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

valueOf

public static LiteralType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDefaultValue

public Literal getDefaultValue()
Returns false if this is a Boolean, 0 if this is an Integer, 0.0 if this is a Double, and the empty string if this is a String.


toString

public java.lang.String toString()
returns bool, fp, int, or string as appropriate

Overrides:
toString in class java.lang.Enum<LiteralType>