|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjas.space.GridPosition
public class GridPosition
An object representing a position on a grid. It has a couple of coordinates just like a Point object, but it is used specifically for Grid implementations.
Title: JAS
Description: Java Agent-based Simulation library
Copyright (C) 2002 Michele Sonnessa
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
| Constructor Summary | |
|---|---|
GridPosition()
Create a new position at (0, 0). |
|
GridPosition(int xPosition,
int yPosition)
Create a new position at the given coordinates. |
|
| Method Summary | |
|---|---|
int |
getX()
Return the x coordinate. |
int |
getY()
Return the y coordinate. |
void |
setX(int x)
Set the x coordinate. |
void |
setY(int y)
Set the y coordinate. |
java.lang.String |
toString()
A string in the (x, y) format representing a position. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GridPosition()
public GridPosition(int xPosition,
int yPosition)
xPosition - The x coordinate.yPosition - The y coordinate.| Method Detail |
|---|
public int getX()
getX in interface IGridPositionpublic int getY()
getY in interface IGridPositionpublic void setX(int x)
setX in interface IGridPositionx - The x position on the grid.public void setY(int y)
setY in interface IGridPositiony - The y position on the grid.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||