|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sysModel.env.NoGridEnv.Location
public static class NoGridEnv.Location
Concrete location class.
Field Summary | |
---|---|
private double |
_x
Column. |
private double |
_y
Row. |
Constructor Summary | |
---|---|
NoGridEnv.Location(double x,
double y)
Constructor. |
Method Summary | |
---|---|
NoGridEnv.Location |
getNeighbor(NoGridEnv.Direction dir)
Return the location of a neighbor in the given direction. |
double |
getX()
Return column. |
double |
getY()
Return row. |
boolean |
inSquare(NoGridEnv.Location other,
NoGridEnv.Direction forward,
double side)
Return true of the other location is in a square with this location at the center, facing in the given direction, with sides of the specified length. |
static NoGridEnv.Location |
parse(Lexer l)
Parses a location. |
boolean |
same(NoGridEnv.Location other)
Return true of this location is the same as the other. |
void |
setX(double _x)
Set column. |
void |
setY(double _y)
Set row. |
java.lang.String |
toString()
Overridden toString method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double _x
private double _y
Constructor Detail |
---|
public NoGridEnv.Location(double x, double y)
x
- columny
- rowMethod Detail |
---|
public double getX()
public double getY()
public void setX(double _x)
_x
- New columnpublic void setY(double _y)
_y
- New rowpublic boolean same(NoGridEnv.Location other)
other
- other location
public boolean inSquare(NoGridEnv.Location other, NoGridEnv.Direction forward, double side)
other
- location to compare toforward
- direction the square is facing (this direction is perpendicular to two of the side walls)side
- side length
public NoGridEnv.Location getNeighbor(NoGridEnv.Direction dir)
dir
- the direction of the neighbor to be returned
public java.lang.String toString()
toString
in class java.lang.Object
public static NoGridEnv.Location parse(Lexer l)
l
- parser to read from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |