public static enum TwoDimensional.Bias extends java.lang.Enum<TwoDimensional.Bias>
For example, given the following two dimensional object (a list of lists of objects) where the inner lists values show the absolute index of that specific item within the outer list...
[ // outer list
[0, 1, 2, 3], // inner list 1
[4, 5, 6] // inner list 2
] // outer list
...navigating to listOfListsObject.offsetTo(3, BACKWARD)
will return 3
whereas
listOfListsObject.offsetTo(3, FORWARD)
will return 4
, the "next item" in the two
dimensional object.
The Bias does not apply if the index is any non-last-index in the inner list. Thus,
listOfListsObject.offsetTo(1, BACKWARD)
and listOfListsObject.offsetTo(1, FORWARD)
will return the same value, 1
, since the position is not at the end of the list.Enum Constant | Description |
---|---|
Backward |
When the returned value would be equal to the last index in an "inner list" or the length of some object
with length, returns the value unmodified.
|
Forward |
When the returned value would be equal to the last index in an "inner list" or the length of some object
with length, returns the
value + 1 . |
Modifier and Type | Method | Description |
---|---|---|
static TwoDimensional.Bias |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static TwoDimensional.Bias[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TwoDimensional.Bias Forward
value + 1
. See TwoDimensional.Bias
for more clarification.public static final TwoDimensional.Bias Backward
TwoDimensional.Bias
for more clarification.public static TwoDimensional.Bias[] values()
for (TwoDimensional.Bias c : TwoDimensional.Bias.values()) System.out.println(c);
public static TwoDimensional.Bias valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null