Get RobotChase at SourceForge.net. Fast, secure and Free Open Source software downloads

org.gcs.robot
Enum Key

java.lang.Object
  extended by java.lang.Enum<Key>
      extended by org.gcs.robot.Key
All Implemented Interfaces:
Serializable, Comparable<Key>

public enum Key
extends Enum<Key>

The Key enumeration.

Author:
John B. Matthews

Enum Constant Summary
Animation
           
ChangeSet
           
EAST
           
EditKeys
           
Help
           
JUMP
           
NE
           
NewGame
           
NORTH
           
NW
           
Quit
           
ResetScore
           
SE
           
SOUTH
           
STAY
           
SW
           
WEST
           
 
Method Summary
 int getKeyCode()
          Get this Key's keyCode.
 int getMove()
          Return a move corresponding to this Key.
static Key lookup(int keyCode)
          Return the Key corresponding to the given keyCode.
 void setKeyCode(int keyCode)
          Set this Key's keyCode; mark keyMap for rehash.
static Key valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Key[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

JUMP

public static final Key JUMP

SW

public static final Key SW

SOUTH

public static final Key SOUTH

SE

public static final Key SE

WEST

public static final Key WEST

STAY

public static final Key STAY

EAST

public static final Key EAST

NW

public static final Key NW

NORTH

public static final Key NORTH

NE

public static final Key NE

Animation

public static final Key Animation

ChangeSet

public static final Key ChangeSet

EditKeys

public static final Key EditKeys

Help

public static final Key Help

NewGame

public static final Key NewGame

Quit

public static final Key Quit

ResetScore

public static final Key ResetScore
Method Detail

values

public static final Key[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Key c : Key.values())
        System.out.println(c);

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

valueOf

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

getKeyCode

public int getKeyCode()
Get this Key's keyCode.


setKeyCode

public void setKeyCode(int keyCode)
Set this Key's keyCode; mark keyMap for rehash.


getMove

public int getMove()
Return a move corresponding to this Key.


lookup

public static Key lookup(int keyCode)
Return the Key corresponding to the given keyCode.


Get RobotChase at SourceForge.net. Fast, secure and Free Open Source software downloads

Copyright © 2007 Gem City Software. Distributed under the terms of the GPL