|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.examples.monkeys.PhysicalObject
An object in the monkey and bananas world.
Field Summary | |
private java.awt.Point |
at
The position of this object. |
private java.lang.String |
description
A description of this object. |
private PhysicalObject |
on
The object over which this one is on. |
private int |
weight
The weight of this object. |
Fields inherited from interface jeops.examples.monkeys.Constants |
ACTIVE,
AT,
CEILING,
FLOOR,
HEAVY,
HOLD,
LIGHT,
ON,
SATISFIED |
Constructor Summary | |
PhysicalObject(java.lang.String description,
int weight)
Class constructor. |
|
PhysicalObject(java.lang.String description,
java.awt.Point at,
int weight)
Class constructor. |
Method Summary | |
java.awt.Point |
getAt()
Returns the position of this object. |
java.lang.String |
getDescription()
Returns a description of this object. |
PhysicalObject |
getOn()
Returns the object over which this one is on. |
int |
getWeight()
Returns the weight of this object. |
boolean |
isAt(java.awt.Point p)
Checks whether this object is at a given position. |
boolean |
isOn(java.lang.Object o)
Checks whether this object is on a given object. |
void |
setAt(java.awt.Point newAt)
Defines the position of this object. |
void |
setOn(PhysicalObject value)
Defines the object over which this one is on. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.awt.Point at
private PhysicalObject on
private java.lang.String description
private int weight
Constructor Detail |
public PhysicalObject(java.lang.String description, int weight)
description
- a description of this object.weight
- the weight of this object.public PhysicalObject(java.lang.String description, java.awt.Point at, int weight)
description
- a description of this object.at
- the position of this objectweight
- the weight of this object.Method Detail |
public java.awt.Point getAt()
public java.lang.String getDescription()
public PhysicalObject getOn()
public int getWeight()
public boolean isAt(java.awt.Point p)
p
- the position being checked.true
if the object is at the given position;
false
otherwise.public boolean isOn(java.lang.Object o)
o
- the object being checked.true
if the object is on the given object;
false
otherwise.public void setAt(java.awt.Point newAt)
newAt
- the new position of this object.public void setOn(PhysicalObject value)
value
- the object over which this one is on.public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |