|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.TupleNi<Tuple2i>
org.openmali.vecmath2.Tuple2i
public class Tuple2i
A simple two-dimensional tuple implementation. Inspired by Kenji Hiranabe's Tuple2i implementation
| Field Summary |
|---|
| Fields inherited from class org.openmali.vecmath2.TupleNi |
|---|
isDirty, N, roTrick, values |
| Constructor Summary | |
|---|---|
|
Tuple2i()
Creates a new Tuple2i instance. |
protected |
Tuple2i(boolean readOnly)
Creates a new Tuple2i instance. |
protected |
Tuple2i(boolean readOnly,
int[] values,
boolean[] isDirty,
boolean copy)
Creates a new Tuple2i instance. |
protected |
Tuple2i(boolean readOnly,
int x,
int y)
Creates a new Tuple2i instance. |
protected |
Tuple2i(boolean readOnly,
Tuple2i that)
Creates a new Tuple2i instance. |
|
Tuple2i(int[] values)
Creates a new Tuple2i instance. |
|
Tuple2i(int x,
int y)
Creates a new Tuple2i instance. |
|
Tuple2i(Tuple2i that)
Creates a new Tuple2i instance. |
| Method Summary | |
|---|---|
Tuple2i |
add(int x,
int y)
Adds the given parameters to this tuple's values. |
Tuple2i |
addX(int v)
Adds v to this tuple's x value. |
Tuple2i |
addY(int v)
Adds v to this tuple's y value. |
Tuple2i |
asReadOnly()
|
Tuple2i |
clone()
Creates and returns a copy of this object. |
Tuple2i |
div(int vx,
int vy)
Divides this tuple's values by vx, vy, vz. |
Tuple2i |
divX(int v)
Divides this tuple's x value by v. |
Tuple2i |
divY(int v)
Divides this tuple's y value by v. |
boolean |
equals(java.lang.Object tuple2)
Returns true if the Object t1 is of type Tuple3f and all of the data members of t1 are equal to the corresponding data members in this Tuple2f. |
boolean |
equals(Tuple2i tuple2)
Returns true if all of the data members of GVector vector1 are equal to the corresponding data members in this GVector. |
static Tuple2i |
fromPool()
Allocates an Tuple2i instance from the pool. |
static Tuple2i |
fromPool(int x,
int y)
Allocates an Tuple2i instance from the pool. |
static Tuple2i |
fromPool(Tuple2i tuple)
Allocates an Tuple2i instance from the pool. |
Tuple2i |
getReadOnly()
|
int |
getX()
|
int |
getY()
|
int |
hashCode()
Returns a hash number based on the data values in this object. |
Tuple2i |
mul(int vx,
int vy)
Multiplies this tuple's values with vx, vy. |
Tuple2i |
mulX(int v)
Multiplies this tuple's x value with v. |
Tuple2i |
mulY(int v)
Multiplies this tuple's y value with v. |
static Tuple2i |
newReadOnly()
Creates a new Tuple2i instance. |
static Tuple2i |
newReadOnly(int[] values)
Creates a new Tuple2i instance. |
static Tuple2i |
newReadOnly(int x,
int y)
Creates a new Tuple2i instance. |
static Tuple2i |
newReadOnly(Tuple2i tuple)
Creates a new Tuple2i instance. |
Tuple2i |
scale(int factorX,
int factorY)
Sets the value of this tuple to the scalar multiplication of tuple t1. |
Tuple2i |
set(int x,
int y)
Sets all three values of this Tuple to the specified ones. |
Tuple2i |
setX(int x)
Sets the value of the x-element of this tuple. |
Tuple2i |
setY(int y)
Sets the value of the y-element of this tuple. |
Tuple2i |
sub(int x,
int y)
Subtracts the given parameters from this tuple's values. |
Tuple2i |
subX(int v)
Subtracts v from this tuple's x value. |
Tuple2i |
subY(int v)
Subtracts v from this tuple's y value. |
static void |
toPool(Tuple2i o)
Stores the given Tuple2i instance in the pool. |
java.lang.String |
toString()
Returns a string that contains the values of this Tuple2f. |
int |
x()
|
Tuple2i |
x(int x)
Sets the value of the x-element of this tuple. |
int |
y()
|
Tuple2i |
y(int y)
Sets the value of the y-element of this tuple. |
| Methods inherited from class org.openmali.vecmath2.TupleNi |
|---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, deserialize, get, get, get, getSerializationBufferSize, getSize, getValue, isDirty, isReadOnly, negate, negate, readExternal, scale, scale, scaleAdd, scaleAdd, serialize, set, set, set, setClean, setValue, setZero, sub, sub, writeExternal |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Tuple2i(boolean readOnly,
int x,
int y)
readOnly - x - the x element to usey - the y element to use
protected Tuple2i(boolean readOnly,
int[] values,
boolean[] isDirty,
boolean copy)
readOnly - values - the values array (must be at least size 2)isDirty - the isDirty-valuecopy - copy the array?
protected Tuple2i(boolean readOnly,
Tuple2i that)
readOnly - that - the Tuple2i to copy the values fromprotected Tuple2i(boolean readOnly)
readOnly -
public Tuple2i(int x,
int y)
x - the x element to usey - the y element to usepublic Tuple2i(int[] values)
values - the values array (must be at least size 2)public Tuple2i(Tuple2i that)
that - the Tuple2i to copy the values frompublic Tuple2i()
| Method Detail |
|---|
public final Tuple2i setX(int x)
x -
public final Tuple2i setY(int y)
y -
public final int getX()
public final int getY()
public final Tuple2i x(int x)
x -
public final Tuple2i y(int y)
y -
public final int x()
public final int y()
public final Tuple2i set(int x,
int y)
x - the x element to usey - the y element to use
public final Tuple2i addX(int v)
v -
public final Tuple2i addY(int v)
v -
public final Tuple2i add(int x,
int y)
x - y -
public final Tuple2i subX(int v)
v -
public final Tuple2i subY(int v)
v -
public final Tuple2i sub(int x,
int y)
x - y -
public final Tuple2i mulX(int v)
v -
public final Tuple2i mulY(int v)
v -
public final Tuple2i mul(int vx,
int vy)
vx - vy -
public final Tuple2i divX(int v)
v -
public final Tuple2i divY(int v)
v -
public final Tuple2i div(int vx,
int vy)
vx - vy -
public final Tuple2i scale(int factorX,
int factorY)
factorX - factorY -
public Tuple2i asReadOnly()
asReadOnly in class TupleNi<Tuple2i>TupleNi.getReadOnly()public Tuple2i getReadOnly()
getReadOnly in class TupleNi<Tuple2i>TupleNi.asReadOnly()public int hashCode()
hashCode in class TupleNi<Tuple2i>public boolean equals(Tuple2i tuple2)
equals in class TupleNi<Tuple2i>tuple2 - The vector with which the comparison is made.
public boolean equals(java.lang.Object tuple2)
equals in class TupleNi<Tuple2i>tuple2 - the Object with which the comparison is made
public java.lang.String toString()
toString in class TupleNi<Tuple2i>public Tuple2i clone()
clone in class java.lang.Objectjava.lang.OutOfMemoryError - if there is not enough memory.Cloneable
public static Tuple2i newReadOnly(int x,
int y)
x - the x element to usey - the y element to usepublic static Tuple2i newReadOnly(int[] values)
values - the values array (must be at least size 2)public static Tuple2i newReadOnly(Tuple2i tuple)
tuple - the Tuple2i to copy the values frompublic static Tuple2i newReadOnly()
public static Tuple2i fromPool()
public static Tuple2i fromPool(int x,
int y)
public static Tuple2i fromPool(Tuple2i tuple)
public static void toPool(Tuple2i o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||