public static interface TwoDimensional.Position
Modifier and Type | Method | Description |
---|---|---|
TwoDimensional.Position |
clamp() |
Returns a new position which clamps the minor position to be valid
given the major position.
|
int |
getMajor() |
The major dimension, e.g.
|
int |
getMinor() |
The minor dimension, e.g.
|
TwoDimensional |
getTargetObject() |
The TwoDimensional object that this position refers to.
|
TwoDimensional.Position |
offsetBy(int amount,
TwoDimensional.Bias bias) |
Returns a new position that offsets this position by the given amount
|
boolean |
sameAs(TwoDimensional.Position other) |
Returns
true if the given position is equal to this
position, that is they both point to the same place in the
same two-dimensional object. |
int |
toOffset() |
Converts this position to an overall offset within the original
TwoDimensional item (to which
getTargetObject() refers). |
TwoDimensional getTargetObject()
int getMajor()
int getMinor()
boolean sameAs(TwoDimensional.Position other)
true
if the given position is equal to this
position, that is they both point to the same place in the
same two-dimensional object. Otherwise returns false
.TwoDimensional.Position clamp()
TwoDimensional.Position offsetBy(int amount, TwoDimensional.Bias bias)
int toOffset()
getTargetObject()
refers).
For example, moving a caret to a relative position (paragraph 2, column 3)
might result in the offset value (absolute position) of 28.