public final class IntPair extends Object implements ConstIntPair, Serializable
x, y) of int
values.IntPairFix, IntPairs are mutable.
IntPairFixs were used to substitute Point,
Dimension, Rectangle and others due to their design
flaws, IntPairs can substitute them under a common
type in the rare cases, where their mutability is
really used, e.g. for changeable common locations of multiple
objects.const interface patters by giving the dependent
objects a watertight r/o view.de.frame4j.math,
Complex,
CFun,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
ConstIntPair |
constView()
Provide a r/o view to the IntPair object.
|
boolean |
equals(Object o)
Compare with other Object.
|
int |
getX()
The first value (x, width, real and else).
|
int |
getY()
The second value (y, height, imaginary and else).
|
int |
hashCode()
Get the hashCode.
|
static IntPair |
of(Dimension dim)
Make of Dimension.
|
static IntPair |
of(Point point)
Make of Point.
|
static IntPair |
ofInts(int x,
int y)
Make of two integer values.
|
void |
setX(int x)
Set the first value (x, width, real and else).
|
void |
setY(int y)
The second value (y, height, imaginary and else).
|
String |
toString()
As String (x, y).
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasDim, asIntPairFix, asPoint, asString, calcHash, equalspublic final int getX()
getX in interface ConstIntPairpublic final int getY()
getY in interface ConstIntPairpublic final void setX(int x)
public final void setY(int y)
public static final IntPair ofInts(int x, int y)
public static final IntPair of(Dimension dim)
dim - for width, height; null gets (0, 0)public static final IntPair of(Point point)
point - for x, y; null gets (0, 0)public boolean equals(Object o)
equals in class ObjectConstIntPair.equals(ConstIntPair)public String toString()
toString in class ObjectConstIntPair.asString()public ConstIntPair constView()
ConstIntPair object giving a complete view
to the state of this IntPair. All changes will be seen, but the
ConstIntPair object will under no circumstances allow the holder
to change this IntPair's state.ConstIntPair.asIntPairFix().