|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ascape.model.space.Coordinate org.ascape.model.space.CoordinateDiscrete
public abstract class CoordinateDiscrete
The base class for a location within a regular discrete space.
Field Summary | |
---|---|
protected int[] |
values
Each element of this array represents the position of this coordinate within a dimension, the index of the element. |
Constructor Summary | |
---|---|
CoordinateDiscrete()
Creates a new discrete coordinate. |
|
CoordinateDiscrete(int value)
Creates a new coordinate with the provided position. |
|
CoordinateDiscrete(int[] values)
Creates a new coordinate with the provided dimensional positions. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Determines whether this coordinate is equal to another. |
int |
getDimensionCount()
Returns the number of dimensions this coordinate has. |
int |
getProduct()
Returns the product of all the dimension's values. |
int |
getValueAtDimension(int dimension)
Gets the value at the specified (1-based) dimension. |
int[] |
getValues()
Returns an array of position values for each dimension. |
int |
hashCode()
|
void |
setValueAtDimension(int dimension,
int value)
Sets the value at the specified (1-based) dimension. |
void |
setValues(int[] values)
Sets the position values for this coordinate. |
java.lang.String |
toString()
Returns a string representing this coordinate. |
Methods inherited from class org.ascape.model.space.Coordinate |
---|
add, getDistance |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int[] values
Constructor Detail |
---|
public CoordinateDiscrete()
public CoordinateDiscrete(int[] values)
values
- the valuespublic CoordinateDiscrete(int value)
value
- the valueMethod Detail |
---|
public int getDimensionCount()
public final int[] getValues()
public final void setValues(int[] values)
values
- the valuespublic final int getValueAtDimension(int dimension)
dimension
- the dimension
public final void setValueAtDimension(int dimension, int value)
dimension
- the dimensionvalue
- the valuepublic final int getProduct()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the o
public int hashCode()
hashCode
in class java.lang.Object
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 |