Catalano.Core
Class IntPoint
- java.lang.Object
-
- Catalano.Core.IntPoint
-
public class IntPoint extends java.lang.ObjectClass for representing a pair of coordinates of integer type.
-
-
Field Summary
Fields Modifier and Type Field and Description intxY axis coordinate.intyY axis coordinate.
-
Constructor Summary
Constructors Constructor and Description IntPoint()Initializes a new instance of the IntPoint class.IntPoint(double x, double y)Initializes a new instance of the IntPoint class.IntPoint(DoublePoint point)Initializes a new instance of the IntPoint class.IntPoint(float x, float y)Initializes a new instance of the IntPoint class.IntPoint(FloatPoint point)Initializes a new instance of the IntPoint class.IntPoint(int x, int y)Initializes a new instance of the IntPoint class.IntPoint(IntPoint point)Initializes a new instance of the IntPoint class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidAdd(int value)Adds values of two points.voidAdd(IntPoint point)Adds values of two points.static IntPointAdd(IntPoint point1, IntPoint point2)Adds values of two points.floatDistanceTo(IntPoint anotherPoint)Calculate Euclidean distance between two points.voidDivide(int value)Divides values of two points.voidDivide(IntPoint point)Divides values of two points.static IntPointDivide(IntPoint point1, IntPoint point2)Divides values of two points.booleanequals(java.lang.Object obj)inthashCode()voidMultiply(int value)Multiply values of two points.voidMultiply(IntPoint point)Multiply values of two points.static IntPointMultiply(IntPoint point1, IntPoint point2)Multiply values of two points.voidsetXY(int x, int y)Sets X and Y axis coordinates.voidSubtract(int value)Subtract values of two points.voidSubtract(IntPoint point)Subtract values of two points.static IntPointSubtract(IntPoint point1, IntPoint point2)Subtract values of two points.voidSwap()Swap values between the coordinates.DoublePointtoDoublePoint()Convert IntPoint to DoublePoint.FloatPointtoFloatPoint()Convert IntPoint to FloatPoint.java.lang.StringtoString()
-
-
-
Constructor Detail
-
IntPoint
public IntPoint()
Initializes a new instance of the IntPoint class.
-
IntPoint
public IntPoint(IntPoint point)
Initializes a new instance of the IntPoint class.- Parameters:
point- IntPoint.
-
IntPoint
public IntPoint(int x, int y)Initializes a new instance of the IntPoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
IntPoint
public IntPoint(float x, float y)Initializes a new instance of the IntPoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
IntPoint
public IntPoint(double x, double y)Initializes a new instance of the IntPoint class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
IntPoint
public IntPoint(FloatPoint point)
Initializes a new instance of the IntPoint class.- Parameters:
point- FloatPoint.
-
IntPoint
public IntPoint(DoublePoint point)
Initializes a new instance of the IntPoint class.- Parameters:
point- DoublePoint.
-
-
Method Detail
-
setXY
public void setXY(int x, int y)Sets X and Y axis coordinates.- Parameters:
x- X axis coordinate.y- Y axis coordinate.
-
Add
public void Add(IntPoint point)
Adds values of two points.- Parameters:
point- IntPoint.
-
Add
public static IntPoint Add(IntPoint point1, IntPoint point2)
Adds values of two points.- Parameters:
point1- IntPoint.point2- IntPoint.- Returns:
- IntPoint that contains X and Y axis coordinate.
-
Add
public void Add(int value)
Adds values of two points.- Parameters:
value- Value.
-
Subtract
public void Subtract(IntPoint point)
Subtract values of two points.- Parameters:
point- IntPoint.
-
Subtract
public static IntPoint Subtract(IntPoint point1, IntPoint point2)
Subtract values of two points.- Parameters:
point1- IntPoint.point2- IntPoint.- Returns:
- IntPoint that contains X and Y axis coordinate.
-
Subtract
public void Subtract(int value)
Subtract values of two points.- Parameters:
value-
-
Multiply
public void Multiply(IntPoint point)
Multiply values of two points.- Parameters:
point- IntPoint.
-
Multiply
public static IntPoint Multiply(IntPoint point1, IntPoint point2)
Multiply values of two points.- Parameters:
point1- IntPoint.point2- IntPoint.- Returns:
- IntPoint that contains X and Y axis coordinate.
-
Multiply
public void Multiply(int value)
Multiply values of two points.- Parameters:
value- Value.
-
Divide
public void Divide(IntPoint point)
Divides values of two points.- Parameters:
point- IntPoint.
-
Divide
public static IntPoint Divide(IntPoint point1, IntPoint point2)
Divides values of two points.- Parameters:
point1- IntPoint.point2- IntPoint.- Returns:
- IntPoint that contains X and Y axis coordinate.
-
Divide
public void Divide(int value)
Divides values of two points.- Parameters:
value- Value.
-
DistanceTo
public float DistanceTo(IntPoint anotherPoint)
Calculate Euclidean distance between two points.- Parameters:
anotherPoint- Point to calculate distance to.- Returns:
- Euclidean distance between this point and anotherPoint points.
-
toFloatPoint
public FloatPoint toFloatPoint()
Convert IntPoint to FloatPoint.- Returns:
- FloatPoint.
-
toDoublePoint
public DoublePoint toDoublePoint()
Convert IntPoint to DoublePoint.- Returns:
- DoublePoint.
-
Swap
public void Swap()
Swap values between the coordinates.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG