|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.IntegerPosition
public final class IntegerPosition
Provides functionality for a position which represents 2D or 3D coordinates
as integers in the game framework. Instances of this class are immutable.
Instances are pooled, and are obtained through the get()
method.
The coordinates must be positive.
Method Summary | |
---|---|
IPosition |
add(int x,
int y,
int z)
Add the given position to this. |
IPosition |
add(IPosition position)
Add the given position to this. |
Object |
clone()
Return a clone of this instance. |
int |
compareTo(Object object)
Compare this to the given object. |
static void |
configure(Properties properties)
Configure this class. |
boolean |
equals(Object object)
Return true if this equals another. |
static IntegerPosition |
get()
Return an integer position with coordinates ( 0, 0, 0 ). |
static IntegerPosition |
get(int x,
int y)
Return an integer position with coordinates ( x, y, 0 ). |
static IntegerPosition |
get(int x,
int y,
int z)
Return an integer position for the given coordinates. |
static int |
getDimensionX()
Return the X dimension of the object pool. |
static int |
getDimensionY()
Return the Y dimension of the object pool. |
static int |
getDimensionZ()
Return the Z dimension of the object pool. |
static int |
getInstanceCount()
Return the count of instances created. |
static Set |
getInstances()
Return the set of instances so far created. |
int |
getX()
Return the x coordinate. |
int |
getY()
Return the y coordinate. |
int |
getZ()
Return the z coordinate. |
int |
hashCode()
Returns a hash code value for the object. |
static IntegerPosition |
parsePosition(String string)
Parse the given string to create an IntegerPosition . |
static void |
setDimensions(int fileCount,
int rankCount,
int levelCount)
Set the dimensions of the pool. |
IPosition |
subtract(int x,
int y,
int z)
Subtract the given position from this. |
IPosition |
subtract(IPosition position)
Subtract the given position from this. |
String |
toParsableString()
Return a parsable string representation of this object. |
String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static void configure(Properties properties) throws InstantiationException, IllegalAccessException
properties
- Source of configuration information.
InstantiationException
IllegalAccessException
public static IntegerPosition get()
public static IntegerPosition get(int x, int y)
x
- X coordinate.y
- Y coordinate.
IllegalArgumentException
- if x less than 0 or y less than 0.public static IntegerPosition get(int x, int y, int z)
x
- X coordinate.y
- Y coordinate.z
- Z coordinate.
IllegalArgumentException
- if x less than 0, y less than 0 or z
less than 0.public static int getDimensionX()
public static int getDimensionY()
public static int getDimensionZ()
public static int getInstanceCount()
public static Set getInstances()
public static IntegerPosition parsePosition(String string)
IntegerPosition
.
string
- String to parse.public static void setDimensions(int fileCount, int rankCount, int levelCount)
fileCount
- File count.rankCount
- Rank count.levelCount
- Level count.public IPosition add(IPosition position)
add
in interface IPosition
position
- The position to add. This is assumed to be a
IntegerPosition
object.
public IPosition add(int x, int y, int z)
x
- The x coordinate to add.y
- The y coordinate to add.z
- The z coordinate to add.
public final Object clone()
clone
in interface IPosition
clone
in class Object
public int compareTo(Object object)
compareTo
in interface Comparable
public boolean equals(Object object)
equals
in class Object
public int getX()
public int getY()
public int getZ()
public int hashCode()
hashCode
in class Object
public IPosition subtract(IPosition position)
subtract
in interface IPosition
position
- The position to subtract. This is assumed to be a
IntegerPosition
object.
public IPosition subtract(int x, int y, int z)
x
- The x coordinate to subtract.y
- The y coordinate to subtract.z
- The z coordinate to subtract.
IllegalArgumentException
- if the any coordinate of the
subtraction is less than zero.public String toParsableString()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |