|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGeneralGridCoordinates
GeneralGridCoordinates.Immutable
public static final class GeneralGridCoordinates.Immutable
An immutable GridCoordinates
. This is sometime useful for creating a single
instance to be shared by many objects without the cost of cloning. This class is
final in order to prevent subclasses from making it mutable again.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class GeneralGridCoordinates |
---|
GeneralGridCoordinates.Immutable |
Constructor Summary | |
---|---|
GeneralGridCoordinates.Immutable(GridCoordinates coordinates)
Creates an immutable grid coordinates with the specified values. |
|
GeneralGridCoordinates.Immutable(int[] coordinates)
Creates an immutable grid coordinates with the specified values. |
|
GeneralGridCoordinates.Immutable(int[] coordinates,
int lower,
int upper)
Creates an immutable grid coordinates with the specified values in the specified range. |
Method Summary | |
---|---|
GeneralGridCoordinates |
clone()
Returns a mutable clone of this grid coordinates. |
void |
setCoordinateValue(int dimension,
int value)
Do not allows modification of this grid coordinates. |
Methods inherited from class GeneralGridCoordinates |
---|
equals, getCoordinateValue, getCoordinateValues, getDimension, hashCode, toString |
Methods inherited from class Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeneralGridCoordinates.Immutable(int[] coordinates)
coordinates
- The grid coordinates to copy.public GeneralGridCoordinates.Immutable(int[] coordinates, int lower, int upper)
coordinates
- The coordinates to copy.lower
- Index of the first value to copy, inclusive.upper
- Index of the last value to copy, exclusive.public GeneralGridCoordinates.Immutable(GridCoordinates coordinates)
coordinates
- The grid coordinates to copy.Method Detail |
---|
public void setCoordinateValue(int dimension, int value) throws UnsupportedOperationException
setCoordinateValue
in interface GridCoordinates
setCoordinateValue
in class GeneralGridCoordinates
dimension
- The index of the value to set.value
- The new value.
UnsupportedOperationException
- always thrown.public GeneralGridCoordinates clone()
GeneralGridCoordinates
rather than this Immutable
subclass.
clone
in class GeneralGridCoordinates
Object.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |