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
Constructor | Description |
---|---|
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
Field | Description |
---|---|
EMPTY | Represents a Point that has Point.X and Point.Y values set to zero. |
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
x | int | The horizontal position of the point. |
y | int | The vertical position of the point. |
Point(Size sz)
public Point(Size sz)
Parameters:
Parameter | Type | Description |
---|---|---|
sz | Size |
Point(int dw)
public Point(int dw)
Initializes a new instance of the Point struct using coordinates specified by an integer value.
Parameters:
Parameter | Type | Description |
---|---|---|
dw | int | The 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:
Parameter | Type | Description |
---|---|---|
p | Point | The 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:
Parameter | Type | Description |
---|---|---|
p | Point |
Returns: Size
op_Addition(Point pt, Size sz)
public static Point op_Addition(Point pt, Size sz)
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | |
sz | Size |
Returns: Point
op_Subtraction(Point pt, Size sz)
public static Point op_Subtraction(Point pt, Size sz)
Parameters:
Parameter | Type | Description |
---|---|---|
pt | Point | |
sz | Size |
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:
Parameter | Type | Description |
---|---|---|
left | Point | First Point to compare. |
right | Point | Second 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:
Parameter | Type | Description |
---|---|---|
left | Point | First Point to compare. |
right | Point | Second 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:
Parameter | Type | Description |
---|---|---|
pt | Point | The Point to add. |
sz | Size | The 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:
Parameter | Type | Description |
---|---|---|
pt | Point | |
sz | Size |
Returns: Point
ceiling(PointF value)
public static Point ceiling(PointF value)
Parameters:
Parameter | Type | Description |
---|---|---|
value | PointF |
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:
Parameter | Type | Description |
---|---|---|
value | PointF | The 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:
Parameter | Type | Description |
---|---|---|
value | PointF | The 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:
Parameter | Type | Description |
---|---|---|
obj1 | Point | |
obj2 | Point |
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:
Parameter | Type | Description |
---|---|---|
value | int | the 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:
Parameter | Type | Description |
---|---|---|
value | int | the 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:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The 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:
Parameter | Type | Description |
---|---|---|
dx | int | The amount to offset the x-coordinate. |
dy | int | The amount to offset the y-coordinate. |
offset(Point p)
public final void offset(Point p)
Translates this Point by the specified Point.
Parameters:
Parameter | Type | Description |
---|---|---|
p | Point | The 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:
Parameter | Type | Description |
---|---|---|
other | Point | Other 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:
Parameter | Type | Description |
---|---|---|
that | Point |
Clone()
public Point Clone()
Returns: Point
clone()
public Object clone()
Returns: java.lang.Object