|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.client.Action
An Action is a thing that a Piece can do. The Action has a name that is presented to the user and a type. The type is a String.
Note that Actions are assumed to be used only with one Piece, that is if two pieces have the same action, they should have two different instances with the same properties, use method clone(). The type indentifies uniquely the type of action and not the instance.
An Action is performed by a Piece and it can be done toward an object. An action therefore has a property called parameter type that represents the type of the thing the actions is perfomed to. The parameter types are void (nothing), position and piece. For information purposes every action can be given a parameter, but no checking that it is of the correct type is done. The parameter is initilized to null.
Every action has instantaneous flag that indicates whether the action is an action that is performed immediately and that has no time span. Other actions are normally put in a queue and executed in order.
Two actions are considered equals if their types are equal.
Field Summary | |
static int |
PIECE
The parameter type piece. |
static int |
POSITION
The parameter type position. |
static int |
VOID
The parameter type void. |
Constructor Summary | |
Action(Action a)
Constructor for the Action object |
|
Action(Action a,
Object parameter)
Constructor for the Action object |
|
Action(String type,
String name,
int parameterType,
boolean instantaneous)
Constructor for the Action object |
|
Action(String type,
String name,
int parameterType,
boolean instantaneous,
Object parameter)
Constructor for the Action object |
Method Summary | |
Object |
clone()
Description of the Method |
int |
compareTo(Object o)
|
boolean |
equals(Object o)
Description of the Method |
String |
getName()
Gets the Name attribute of the Action object |
Object |
getParameter()
Gets the Parameter attribute of the Action object |
int |
getParameterType()
Gets the ParameterType attribute of the Action object |
String |
getType()
Gets the Type attribute of the Action object |
int |
hashCode()
Description of the Method |
boolean |
isInstantaneous()
Gets the Instantaneous attribute of the Action object |
void |
setParameter(Object o)
Sets the Parameter attribute of the Action object |
String |
toString()
Description of the Method |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int VOID
public static final int POSITION
public static final int PIECE
Constructor Detail |
public Action(String type, String name, int parameterType, boolean instantaneous)
type
- Description of Parametername
- Description of ParameterparameterType
- Description of Parameterinstantaneous
- Description of Parameterpublic Action(String type, String name, int parameterType, boolean instantaneous, Object parameter)
type
- Description of Parametername
- Description of ParameterparameterType
- Description of Parameterinstantaneous
- Description of Parameterparameter
- Description of Parameterpublic Action(Action a)
a
- Description of Parameterpublic Action(Action a, Object parameter)
a
- Description of Parameterparameter
- Description of ParameterMethod Detail |
public void setParameter(Object o)
o
- The new Parameter valuepublic String getType()
public String getName()
public int getParameterType()
public boolean isInstantaneous()
public Object getParameter()
public Object clone()
clone
in class Object
public boolean equals(Object o)
equals
in class Object
o
- Description of Parameter
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |