public class Quadrangle
extends java.lang.Object
Stores a set of four Points that represent a Quadrangle region.
| Modifier and Type | Field and Description |
|---|---|
static Quadrangle |
EMPTY
Represents a
Quadrangle structure with its properties left uninitialized. |
| Constructor and Description |
|---|
Quadrangle() |
Quadrangle(java.awt.Point leftTop,
java.awt.Point rightTop,
java.awt.Point rightBottom,
java.awt.Point leftBottom)
Initializes a new instance of the
Quadrangle structure with the describing points. |
| Modifier and Type | Method and Description |
|---|---|
Quadrangle |
clone() |
boolean |
contains(int x,
int y)
Determines if the specified point is contained within this
Quadrangle structure. |
boolean |
contains(java.awt.Point pt)
Determines if the specified
Point is contained within this Quadrangle structure. |
boolean |
contains(Quadrangle quad)
Determines if the specified
Quadrangle is contained or intersect this Quadrangle structure. |
boolean |
contains(java.awt.Rectangle rect)
Determines if the specified
Rectangle is contained or intersect this Quadrangle structure. |
boolean |
equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified
Quadrangle value. |
boolean |
equals(Quadrangle other)
Returns a value indicating whether this instance is equal to a specified
Quadrangle value. |
static boolean |
equals(Quadrangle obj1,
Quadrangle obj2) |
java.awt.Rectangle |
getBoundingRectangle()
Creates
Rectangle bounding this Quadrangle |
java.awt.Point |
getLeftBottom()
Gets left-bottom corner
Point of Quadrangle region |
java.awt.Point |
getLeftTop()
Gets left-top corner
Point of Quadrangle region |
java.awt.Point |
getRightBottom()
Gets right-bottom corner
Point of Quadrangle region |
java.awt.Point |
getRightTop()
Gets right-top corner
Point of Quadrangle region |
int |
hashCode()
Returns the hash code for this instance.
|
boolean |
isEmpty()
Tests whether all
Points of this Quadrangle have values of zero. |
static boolean |
op_Equality(Quadrangle first,
Quadrangle second)
Returns a value indicating whether the first
Quadrangle value is equal to the second. |
static boolean |
op_Inequality(Quadrangle first,
Quadrangle second)
Returns a value indicating if the first
Quadrangle value is different from the second. |
void |
setLeftBottom(java.awt.Point value)
Gets left-bottom corner
Point of Quadrangle region |
void |
setLeftTop(java.awt.Point value)
Gets left-top corner
Point of Quadrangle region |
void |
setRightBottom(java.awt.Point value)
Gets right-bottom corner
Point of Quadrangle region |
void |
setRightTop(java.awt.Point value)
Gets right-top corner
Point of Quadrangle region |
java.lang.String |
toString()
Returns a human-readable string representation of this
Quadrangle. |
public static final Quadrangle EMPTY
Represents a Quadrangle structure with its properties left uninitialized.
Quadranglepublic Quadrangle()
public Quadrangle(java.awt.Point leftTop,
java.awt.Point rightTop,
java.awt.Point rightBottom,
java.awt.Point leftBottom)
Initializes a new instance of the Quadrangle structure with the describing points.
leftTop - A Point that represents the left-top corner of the Quadrangle.rightTop - A Point that represents the right-top corner of the Quadrangle.rightBottom - A Point that represents the right-bottom corner of the Quadrangle.leftBottom - A Point that represents the left-bottom corner of the Quadrangle.public java.awt.Point getLeftTop()
Gets left-top corner Point of Quadrangle region
Point of Quadrangle regionpublic void setLeftTop(java.awt.Point value)
Gets left-top corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getRightTop()
Gets right-top corner Point of Quadrangle region
Point of Quadrangle regionpublic void setRightTop(java.awt.Point value)
Gets right-top corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getRightBottom()
Gets right-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic void setRightBottom(java.awt.Point value)
Gets right-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic java.awt.Point getLeftBottom()
Gets left-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic void setLeftBottom(java.awt.Point value)
Gets left-bottom corner Point of Quadrangle region
Point of Quadrangle regionpublic boolean isEmpty()
Tests whether all Points of this Quadrangle have values of zero.
<b>true</b> if all Points of this Quadrangle have values of zero; otherwise, <b>false</b>.public boolean contains(java.awt.Point pt)
Determines if the specified Point is contained within this Quadrangle structure.
pt - The Point to test.<b>true</b> if Point is contained within this Quadrangle structure; otherwise, <b>false</b>.public boolean contains(int x,
int y)
Determines if the specified point is contained within this Quadrangle structure.
x - The x point cordinate.y - The y point cordinate.<b>true</b> if point is contained within this Quadrangle structure; otherwise, <b>false</b>.public boolean contains(Quadrangle quad)
Determines if the specified Quadrangle is contained or intersect this Quadrangle structure.
quad - The Quadrangle to test.<b>true</b> if Quadrangle is contained or intersect this Quadrangle structure; otherwise, <b>false</b>.public boolean contains(java.awt.Rectangle rect)
Determines if the specified Rectangle is contained or intersect this Quadrangle structure.
rect - The Rectangle to test.<b>true</b> if Rectangle is contained or intersect this Quadrangle structure; otherwise, <b>false</b>.public boolean equals(Quadrangle other)
Returns a value indicating whether this instance is equal to a specified Quadrangle value.
other - An Quadrangle value to compare to this instance.<b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.public boolean equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified Quadrangle value.
equals in class java.lang.Objectobj - An System.Object value to compare to this instance.<b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.public static boolean op_Equality(Quadrangle first, Quadrangle second)
Returns a value indicating whether the first Quadrangle value is equal to the second.
first - A first compared valuesecond - A second compared value<b>true</b> if first has the same value as second; otherwise, <b>false</b>.public static boolean op_Inequality(Quadrangle first, Quadrangle second)
Returns a value indicating if the first Quadrangle value is different from the second.
first - A first compared valuesecond - A second compared value<b>true</b> if first has the different value from second; otherwise, <b>false</b>.public int hashCode()
Returns the hash code for this instance.
hashCode in class java.lang.Objectpublic java.lang.String toString()
Returns a human-readable string representation of this Quadrangle.
toString in class java.lang.ObjectQuadrangle.public java.awt.Rectangle getBoundingRectangle()
Creates Rectangle bounding this Quadrangle
Rectangle bounding this Quadranglepublic Quadrangle clone()
clone in class java.lang.Objectpublic static boolean equals(Quadrangle obj1, Quadrangle obj2)