Point

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

All Implemented Interfaces: com.aspose.ms.System.IEquatable, java.lang.Cloneable

public class Point extends Struct<Point> implements System.IEquatable<Point>, Cloneable

Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

Constructors

ConstructorDescription
Point()
Point(int x, int y)Initializes a new instance of the Point struct with the specified coordinates.
Point(Size sz)
Point(int dw)Initializes a new instance of the Point struct using coordinates specified by an integer value.

Fields

FieldDescription
EMPTYRepresents a Point that has Point.X and Point.Y values set to zero.

Methods

MethodDescription
to_PointF(Point p)Converts the specified Point structure to a PointF structure.
to_Size(Point p)
op_Addition(Point pt, Size sz)
op_Subtraction(Point pt, Size sz)
op_Equality(Point left, Point right)Compares two Point objects.
op_Inequality(Point left, Point right)Compares two Point objects.
add(Point pt, Size sz)Adds the specified Size to the specified Point.
subtract(Point pt, Size sz)
ceiling(PointF value)
truncate(PointF value)Converts a PointF to a Point by performing a truncate operation on all the coordinates.
round(PointF value)Converts the specified PointF to a Point object by rounding the Point values to the nearest integer.
isEquals(Point obj1, Point obj2)
getEmpty()
getX()Gets the x-coordinate of this Point.
setX(int value)Sets the x-coordinate of this Point.
getY()Gets the y-coordinate of this Point.
setY(int value)Sets the y-coordinate of this Point.
isEmpty()Gets a value indicating whether this this Point is empty.
hashCode()Returns a hash code for this Point.
toString()
equals(Object obj)Specifies whether this Point contains the same coordinates as the specified Object.
offset(int dx, int dy)Translates this Point by the specified amount.
offset(Point p)Translates this Point by the specified Point.
equals(Point other)Tests whether other Point structure has the same location of this Point structure.
CloneTo(Point that)
Clone()
clone()

Point()

public Point()

Point(int x, int y)

public Point(int x, int y)

Initializes a new instance of the Point struct with the specified coordinates.

Parameters:

ParameterTypeDescription
xintThe horizontal position of the point.
yintThe vertical position of the point.

Point(Size sz)

public Point(Size sz)

Parameters:

ParameterTypeDescription
szSize

Point(int dw)

public Point(int dw)

Initializes a new instance of the Point struct using coordinates specified by an integer value.

Parameters:

ParameterTypeDescription
dwintThe integer value.

EMPTY

public static final Point EMPTY

Represents a Point that has Point.X and Point.Y values set to zero.

to_PointF(Point p)

public static PointF to_PointF(Point p)

Converts the specified Point structure to a PointF structure.

Parameters:

ParameterTypeDescription
pPointThe Point to be converted.

Returns: PointF - The PointF that results from the conversion.

to_Size(Point p)

public static Size to_Size(Point p)

Parameters:

ParameterTypeDescription
pPoint

Returns: Size

op_Addition(Point pt, Size sz)

public static Point op_Addition(Point pt, Size sz)

Parameters:

ParameterTypeDescription
ptPoint
szSize

Returns: Point

op_Subtraction(Point pt, Size sz)

public static Point op_Subtraction(Point pt, Size sz)

Parameters:

ParameterTypeDescription
ptPoint
szSize

Returns: Point

op_Equality(Point left, Point right)

public static boolean op_Equality(Point left, Point right)

Compares two Point objects. The result specifies whether the values of the Point.X and Point.Y properties of the two Point objects are equal.

Parameters:

ParameterTypeDescription
leftPointFirst Point to compare.
rightPointSecond Point to compare.

Returns: boolean - true if the Point.X and Point.Y values of left and right are equal; otherwise, false.

op_Inequality(Point left, Point right)

public static boolean op_Inequality(Point left, Point right)

Compares two Point objects. The result specifies whether the values of the Point.X or Point.Y properties of the two Point objects are unequal.

Parameters:

ParameterTypeDescription
leftPointFirst Point to compare.
rightPointSecond Point to compare.

Returns: boolean - true if the values of either the Point.X properties or the Point.Y properties of left and right differ; otherwise, false.

add(Point pt, Size sz)

public static Point add(Point pt, Size sz)

Adds the specified Size to the specified Point.

Parameters:

ParameterTypeDescription
ptPointThe Point to add.
szSizeThe Size to add

Returns: Point - The Point that is the result of the addition operation.

subtract(Point pt, Size sz)

public static Point subtract(Point pt, Size sz)

Parameters:

ParameterTypeDescription
ptPoint
szSize

Returns: Point

ceiling(PointF value)

public static Point ceiling(PointF value)

Parameters:

ParameterTypeDescription
valuePointF

Returns: Point

truncate(PointF value)

public static Point truncate(PointF value)

Converts a PointF to a Point by performing a truncate operation on all the coordinates.

Parameters:

ParameterTypeDescription
valuePointFThe PointF to truncate.

Returns: Point - The Point that is the result of the truncate operation.

round(PointF value)

public static Point round(PointF value)

Converts the specified PointF to a Point object by rounding the Point values to the nearest integer.

Parameters:

ParameterTypeDescription
valuePointFThe PointF to convert.

Returns: Point - The Point this method converts to.

isEquals(Point obj1, Point obj2)

public static boolean isEquals(Point obj1, Point obj2)

Parameters:

ParameterTypeDescription
obj1Point
obj2Point

Returns: boolean

getEmpty()

public static Point getEmpty()

Returns: Point

getX()

public final int getX()

Gets the x-coordinate of this Point.

Returns: int - the x-coordinate of this Point.

setX(int value)

public final void setX(int value)

Sets the x-coordinate of this Point.

Parameters:

ParameterTypeDescription
valueintthe x-coordinate of this Point.

getY()

public final int getY()

Gets the y-coordinate of this Point.

Returns: int - the y-coordinate of this Point.

setY(int value)

public final void setY(int value)

Sets the y-coordinate of this Point.

Parameters:

ParameterTypeDescription
valueintthe y-coordinate of this Point.

isEmpty()

public final boolean isEmpty()

Gets a value indicating whether this this Point is empty.

Value: true if both X and Y are 0; otherwise, false.

Returns: boolean - a value indicating whether this this Point is empty.

hashCode()

public int hashCode()

Returns a hash code for this Point.

Returns: int - An integer value that specifies a hash value for this Point.

toString()

public String toString()

Returns: java.lang.String

equals(Object obj)

public boolean equals(Object obj)

Specifies whether this Point contains the same coordinates as the specified Object.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Object to test.

Returns: boolean - true if obj is a Point and has the same coordinates as this Point.

offset(int dx, int dy)

public final void offset(int dx, int dy)

Translates this Point by the specified amount.

Parameters:

ParameterTypeDescription
dxintThe amount to offset the x-coordinate.
dyintThe amount to offset the y-coordinate.

offset(Point p)

public final void offset(Point p)

Translates this Point by the specified Point.

Parameters:

ParameterTypeDescription
pPointThe Point used offset this Point.

equals(Point other)

public final boolean equals(Point other)

Tests whether other Point structure has the same location of this Point structure.

Parameters:

ParameterTypeDescription
otherPointOther point to test

Returns: boolean - This method returns true if other Point structure and its X and Y properties are equal to the corresponding properties of this Point structure; otherwise, false.

CloneTo(Point that)

public void CloneTo(Point that)

Parameters:

ParameterTypeDescription
thatPoint

Clone()

public Point Clone()

Returns: Point

clone()

public Object clone()

Returns: java.lang.Object