Class Tuple2i<RT extends Tuple2i<? super RT>>
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.i.Tuple2i<RT>
-
- Type Parameters:
RT- is the replied type by the tuple.
- All Implemented Interfaces:
Serializable,Cloneable,Tuple2D<RT>,JsonableObject
public class Tuple2i<RT extends Tuple2i<? super RT>> extends Object implements Tuple2D<RT>
2D tuple with 2 integer numbers.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Constructor Summary
Constructors Constructor Description Tuple2i()Construct aa zero tuple.Tuple2i(double[] tuple)Constructor by copy.Tuple2i(double x, double y)Construct a tuple with the given coordinates.Tuple2i(int[] tuple)Constructor by copy.Tuple2i(int x, int y)Construct a tuple with the given coordinates.Tuple2i(Tuple2i<?> tuple)Constructor by copy.Tuple2i(Tuple2D<?> tuple)Constructor by copy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabsolute()Sets each component of this tuple to its absolute value.voidabsolute(Tuple2D<?> tuple)Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.voidadd(double x, double y)Sets the value of this tuple to the sum of itself and x and y.voidadd(int x, int y)Sets the value of this tuple to the sum of itself and x and y.voidaddX(double x)Sets the x value of this tuple to the sum of itself and x.voidaddX(int x)Sets the x value of this tuple to the sum of itself and x.voidaddY(double y)Sets the y value of this tuple to the sum of itself and y.voidaddY(int y)Sets the y value of this tuple to the sum of itself and y.RTclone()Clone this point.booleanequals(Object object)Returns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.doublegetX()Get the x coordinate.doublegetY()Get the y coordinate.inthashCode()Returns a hash code value based on the data values in this object.intix()Get the x coordinate.intiy()Get the y coordinate.voidnegate()Negates the value of this tuple in place.voidnegate(Tuple2D<?> tuple)Sets the value of this tuple to the negation of tuple t1.voidscale(double scale)Sets the value of this tuple to the scalar multiplication of the scale factor with this.voidscale(double scale, Tuple2D<?> tuple)Sets the value of this tuple to the scalar multiplication of tuple t1.voidscale(int scale)Sets the value of this tuple to the scalar multiplication of the scale factor with this.voidscale(int scale, Tuple2D<?> tuple)Sets the value of this tuple to the scalar multiplication of tuple t1.voidset(double[] tuple)Sets the value of this tuple from the 2 values specified in the array.voidset(double x, double y)Sets the value of this tuple to the specified x and y coordinates.voidset(int[] tuple)Sets the value of this tuple from the 2 values specified in the array.voidset(int x, int y)Sets the value of this tuple to the specified x and y coordinates.voidset(Tuple2D<?> tuple)Sets the value of this tuple to the value of tuple t1.voidsetX(double x)Set the x coordinate.voidsetX(int x)Set the x coordinate.voidsetY(double y)Set the y coordinate.voidsetY(int y)Set the y coordinate.voidsub(double x, double y)Sets the value of this tuple to the difference of itself and x and y.voidsub(int x, int y)Sets the value of this tuple to the difference of itself and x and y.voidsubX(double x)Sets the x value of this tuple to the difference of itself and x.voidsubX(int x)Sets the x value of this tuple to the difference of itself and x.voidsubY(double y)Sets the y value of this tuple to the difference of itself and y.voidsubY(int y)Sets the y value of this tuple to the difference of itself and y.voidtoJson(JsonBuffer buffer)Replies the Json representation of this node.StringtoString()
-
-
-
Constructor Detail
-
Tuple2i
public Tuple2i()
Construct aa zero tuple.
-
Tuple2i
public Tuple2i(Tuple2i<?> tuple)
Constructor by copy.- Parameters:
tuple- is the tuple to copy.
-
Tuple2i
public Tuple2i(Tuple2D<?> tuple)
Constructor by copy.- Parameters:
tuple- is the tuple to copy.
-
Tuple2i
public Tuple2i(int[] tuple)
Constructor by copy.- Parameters:
tuple- is the tuple to copy.
-
Tuple2i
public Tuple2i(double[] tuple)
Constructor by copy.- Parameters:
tuple- is the tuple to copy.
-
Tuple2i
public Tuple2i(int x, int y)Construct a tuple with the given coordinates.- Parameters:
x- x coordinate.y- y coordinate.
-
Tuple2i
public Tuple2i(double x, double y)Construct a tuple with the given coordinates.- Parameters:
x- x coordinate.y- y coordinate.
-
-
Method Detail
-
absolute
public void absolute()
Description copied from interface:Tuple2DSets each component of this tuple to its absolute value.
-
absolute
public void absolute(Tuple2D<?> tuple)
Description copied from interface:Tuple2DSets each component of the tuple parameter to its absolute value and places the modified values into this tuple.
-
add
public void add(int x, int y)Description copied from interface:Tuple2DSets the value of this tuple to the sum of itself and x and y.
-
add
public void add(double x, double y)Description copied from interface:Tuple2DSets the value of this tuple to the sum of itself and x and y.
-
addX
public void addX(int x)
Description copied from interface:Tuple2DSets the x value of this tuple to the sum of itself and x.
-
addX
public void addX(double x)
Description copied from interface:Tuple2DSets the x value of this tuple to the sum of itself and x.
-
addY
public void addY(int y)
Description copied from interface:Tuple2DSets the y value of this tuple to the sum of itself and y.
-
addY
public void addY(double y)
Description copied from interface:Tuple2DSets the y value of this tuple to the sum of itself and y.
-
negate
public void negate(Tuple2D<?> tuple)
Description copied from interface:Tuple2DSets the value of this tuple to the negation of tuple t1.
-
negate
public void negate()
Description copied from interface:Tuple2DNegates the value of this tuple in place.
-
scale
public void scale(int scale, Tuple2D<?> tuple)Description copied from interface:Tuple2DSets the value of this tuple to the scalar multiplication of tuple t1.
-
scale
public void scale(double scale, Tuple2D<?> tuple)Description copied from interface:Tuple2DSets the value of this tuple to the scalar multiplication of tuple t1.
-
scale
public void scale(int scale)
Description copied from interface:Tuple2DSets the value of this tuple to the scalar multiplication of the scale factor with this.
-
scale
public void scale(double scale)
Description copied from interface:Tuple2DSets the value of this tuple to the scalar multiplication of the scale factor with this.
-
set
public void set(Tuple2D<?> tuple)
Description copied from interface:Tuple2DSets the value of this tuple to the value of tuple t1.
-
set
public void set(int x, int y)Description copied from interface:Tuple2DSets the value of this tuple to the specified x and y coordinates.
-
set
public void set(double x, double y)Description copied from interface:Tuple2DSets the value of this tuple to the specified x and y coordinates.
-
set
public void set(int[] tuple)
Description copied from interface:Tuple2DSets the value of this tuple from the 2 values specified in the array.
-
set
public void set(double[] tuple)
Description copied from interface:Tuple2DSets the value of this tuple from the 2 values specified in the array.
-
getX
@Pure public double getX()
Description copied from interface:Tuple2DGet the x coordinate.
-
ix
@Pure public int ix()
Description copied from interface:Tuple2DGet the x coordinate.
-
setX
public void setX(int x)
Description copied from interface:Tuple2DSet the x coordinate.
-
setX
public void setX(double x)
Description copied from interface:Tuple2DSet the x coordinate.
-
getY
@Pure public double getY()
Description copied from interface:Tuple2DGet the y coordinate.
-
iy
@Pure public int iy()
Description copied from interface:Tuple2DGet the y coordinate.
-
setY
public void setY(int y)
Description copied from interface:Tuple2DSet the y coordinate.
-
setY
public void setY(double y)
Description copied from interface:Tuple2DSet the y coordinate.
-
sub
public void sub(int x, int y)Description copied from interface:Tuple2DSets the value of this tuple to the difference of itself and x and y.
-
sub
public void sub(double x, double y)Description copied from interface:Tuple2DSets the value of this tuple to the difference of itself and x and y.
-
subX
public void subX(int x)
Description copied from interface:Tuple2DSets the x value of this tuple to the difference of itself and x.
-
subX
public void subX(double x)
Description copied from interface:Tuple2DSets the x value of this tuple to the difference of itself and x.
-
subY
public void subY(int y)
Description copied from interface:Tuple2DSets the y value of this tuple to the difference of itself and y.
-
subY
public void subY(double y)
Description copied from interface:Tuple2DSets the y value of this tuple to the difference of itself and y.
-
equals
@Pure public boolean equals(Object object)
Description copied from interface:Tuple2DReturns true if the Object t1 is of type Tuple2D and all of the data members of t1 are equal to the corresponding data members in this Tuple2D.
-
hashCode
@Pure public int hashCode()
Description copied from interface:Tuple2DReturns a hash code value based on the data values in this object. Two differentTuple2Dobjects with identical data values (i.e.,Tuple2D.equals(Object)returns true) will return the same hash code value. Two objects with different data members may return the same hash value, although this is not likely.
-
toJson
public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Parameters:
buffer- the Json buffer.
-
-