org.openmali.vecmath2
Class Point2i

java.lang.Object
  extended by org.openmali.vecmath2.Tuple2i
      extended by org.openmali.vecmath2.Point2i
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class Point2i
extends Tuple2i
implements java.io.Externalizable

A 2 element point that is represented by signed integer x,y coordinates. Inspired by Kenji Hiranabe's Point2i implementation

Author:
Marvin Froehlich (aka Qudus)
See Also:
Serialized Form

Field Summary
static Point2i ZERO
           
 
Fields inherited from class org.openmali.vecmath2.Tuple2i
N, roTrick, values
 
Constructor Summary
  Point2i()
          Constructs and initializes a Point3i to (0,0,0).
protected Point2i(boolean readOnly)
          Constructs and initializes a Point3i to (0,0,0).
protected Point2i(boolean readOnly, int[] values)
          Constructs and initializes a Point3i from the specified array.
protected Point2i(boolean readOnly, int x, int y)
          Constructs and initializes a Point3i from the specified xyz coordinates.
protected Point2i(boolean readOnly, Tuple2i tuple)
          Constructs and initializes a Point3i from the specified Point3i.
  Point2i(int[] values)
          Constructs and initializes a Point3i from the specified array.
  Point2i(int x, int y)
          Constructs and initializes a Point3i from the specified xyz coordinates.
  Point2i(Tuple2i tuple)
          Constructs and initializes a Point3i from the specified Point3i.
 
Method Summary
static Point2i fromPool()
          Allocates an Point2i instance from the pool.
static Point2i fromPool(int x, int y)
          Allocates an Point2i instance from the pool.
static Point2i fromPool(Tuple2i tuple)
          Allocates an Point2i instance from the pool.
static Point2i newReadOnly()
          Constructs and initializes a Point3i to (0,0,0).
static Point2i newReadOnly(int[] values)
          Constructs and initializes a Point3i from the specified array.
static Point2i newReadOnly(int x, int y)
          Constructs and initializes a Point3i from the specified xyz coordinates.
static Point2i newReadOnly(Tuple2i tuple)
          Constructs and initializes a Point3i from the specified Point3i.
static void toPool(Point2i o)
          Stores the given Point2i instance in the pool.
 
Methods inherited from class org.openmali.vecmath2.Tuple2i
absolute, absolute, add, add, add, addX, addY, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, deserialize, div, divX, divY, equals, equals, get, get, getSerializationBufferSize, getSize, getValue, getX, getY, hashCode, isDirty, isReadOnly, mul, mulX, mulY, negate, negate, readExternal, scale, scale, scale, scaleAdd, scaleAdd, serialize, set, set, set, setClean, setValue, setX, setY, setZero, sub, sub, sub, subX, subY, toPool, toString, writeExternal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

ZERO

public static final Point2i ZERO
Constructor Detail

Point2i

protected Point2i(boolean readOnly,
                  int x,
                  int y)
Constructs and initializes a Point3i from the specified xyz coordinates.

Parameters:
readOnly -
x - the x coordinate
y - the y coordinate

Point2i

protected Point2i(boolean readOnly,
                  int[] values)
Constructs and initializes a Point3i from the specified array.

Parameters:
readOnly -
values - the array of length 3 containing xyz in order

Point2i

protected Point2i(boolean readOnly,
                  Tuple2i tuple)
Constructs and initializes a Point3i from the specified Point3i.

Parameters:
readOnly -
tuple - the Point3i containing the initialization x y z data

Point2i

protected Point2i(boolean readOnly)
Constructs and initializes a Point3i to (0,0,0).

Parameters:
readOnly -

Point2i

public Point2i(int x,
               int y)
Constructs and initializes a Point3i from the specified xyz coordinates.

Parameters:
x - the x coordinate
y - the y coordinate

Point2i

public Point2i(int[] values)
Constructs and initializes a Point3i from the specified array.

Parameters:
values - the array of length 3 containing xyz in order

Point2i

public Point2i(Tuple2i tuple)
Constructs and initializes a Point3i from the specified Point3i.

Parameters:
tuple - the Point3i containing the initialization x y z data

Point2i

public Point2i()
Constructs and initializes a Point3i to (0,0,0).

Method Detail

newReadOnly

public static Point2i newReadOnly(int x,
                                  int y)
Constructs and initializes a Point3i from the specified xyz coordinates.

Parameters:
x - the x coordinate
y - the y coordinate

newReadOnly

public static Point2i newReadOnly(int[] values)
Constructs and initializes a Point3i from the specified array.

Parameters:
values - the array of length 3 containing xyz in order

newReadOnly

public static Point2i newReadOnly(Tuple2i tuple)
Constructs and initializes a Point3i from the specified Point3i.

Parameters:
tuple - the Point3i containing the initialization x y z data

newReadOnly

public static Point2i newReadOnly()
Constructs and initializes a Point3i to (0,0,0).


fromPool

public static Point2i fromPool()
Allocates an Point2i instance from the pool.


fromPool

public static Point2i fromPool(int x,
                               int y)
Allocates an Point2i instance from the pool.


fromPool

public static Point2i fromPool(Tuple2i tuple)
Allocates an Point2i instance from the pool.


toPool

public static void toPool(Point2i o)
Stores the given Point2i instance in the pool.

Parameters:
o -