public static class CellKey.Many extends Object implements CellKey
CellKey.Four, CellKey.Generator, CellKey.Many, CellKey.One, CellKey.Three, CellKey.Two, CellKey.Zero
Modifier | Constructor and Description |
---|---|
protected |
Many(int[] ordinals)
Creates a Many.
|
Modifier and Type | Method and Description |
---|---|
CellKey.Many |
copy()
Returns a mutable copy of this CellKey.
|
boolean |
equals(Object o) |
int |
getAxis(int axis)
Returns the
axis th axis value. |
int |
getOffset(int[] axisMultipliers)
Returns the offset of the cell in a raster-scan order.
|
int[] |
getOrdinals()
Returns the axis keys as an array.
|
int |
hashCode() |
void |
setAxis(int axis,
int value)
Sets a given axis.
|
void |
setOrdinals(int[] pos)
This method make a copy of the int array parameter.
|
int |
size()
Returns the number of axes.
|
String |
toString() |
protected Many(int[] ordinals)
ordinals
- Ordinatespublic final int size()
CellKey
public final void setOrdinals(int[] pos)
CellKey
setOrdinals
in interface CellKey
pos
- Array of axis keyspublic final int[] getOrdinals()
CellKey
Note: caller should treat the array as immutable. If the contents of the array are modified, behavior is unspecified.
getOrdinals
in interface CellKey
public void setAxis(int axis, int value)
CellKey
public int getAxis(int axis)
CellKey
axis
th axis value.public CellKey.Many copy()
CellKey
public int getOffset(int[] axisMultipliers)
CellKey
For example, if the axes have lengths {2, 5, 10} then cell (2, 3, 4) has offset
(2 * mulitiplers[0]) + (3 * multipliers[1]) + (4 * multipliers[2])
= (2 * 50) + (3 * 10) + (4 * 1)
= 134
The multipliers are the product of the lengths of all later axes, in this case (50, 10, 1).
Copyright © 2018 Hitachi Vantara. All rights reserved.