Class Quadrangle


  • public class Quadrangle
    extends java.lang.Object

    Stores a set of four Points that represent a Quadrangle region.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Quadrangle EMPTY
      Represents a Quadrangle class with its properties left uninitialized.
    • Constructor Summary

      Constructors 
      Constructor Description
      Quadrangle()  
      Quadrangle​(android.graphics.Point leftTop, android.graphics.Point rightTop, android.graphics.Point rightBottom, android.graphics.Point leftBottom)
      Initializes a new instance of the Quadrangle structure with the describing points.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Quadrangle clone()  
      boolean contains​(int x, int y)
      Determines if the specified point is contained within this Quadrangle class.
      boolean contains​(android.graphics.Point pt)
      Determines if the specified Point is contained within this Quadrangle class.
      boolean contains​(android.graphics.Rect rect)
      Determines if the specified Rectangle is contained or intersect this Quadrangle class.
      boolean contains​(Quadrangle quad)
      Determines if the specified Quadrangle is contained or intersect this Quadrangle class.
      boolean equals​(java.lang.Object obj)
      Returns a value indicating whether this instance is equal to a specified Quadrangle value.
      android.graphics.Rect getBoundingRectangle()
      Creates Rectangle bounding this Quadrangle
      android.graphics.Point getLeftBottom()
      Gets left-bottom corner Point of Quadrangle region
      android.graphics.Point getLeftTop()
      Gets left-top corner Point of Quadrangle region
      android.graphics.Point getRightBottom()
      Gets right-bottom corner Point of Quadrangle region
      android.graphics.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.
      void setLeftBottom​(android.graphics.Point value)
      Gets left-bottom corner Point of Quadrangle region
      void setLeftTop​(android.graphics.Point value)
      Gets left-top corner Point of Quadrangle region
      void setRightBottom​(android.graphics.Point value)
      Gets right-bottom corner Point of Quadrangle region
      void setRightTop​(android.graphics.Point value)
      Gets right-top corner Point of Quadrangle region
      java.lang.String toString()
      Returns a human-readable string representation of this Quadrangle.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMPTY

        public static final Quadrangle EMPTY

        Represents a Quadrangle class with its properties left uninitialized.

        Value: Quadrangle
    • Constructor Detail

      • Quadrangle

        public Quadrangle()
      • Quadrangle

        public Quadrangle​(android.graphics.Point leftTop,
                          android.graphics.Point rightTop,
                          android.graphics.Point rightBottom,
                          android.graphics.Point leftBottom)

        Initializes a new instance of the Quadrangle structure with the describing points.

        Parameters:
        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.
    • Method Detail

      • getLeftTop

        public android.graphics.Point getLeftTop()

        Gets left-top corner Point of Quadrangle region

        Value: A left-top corner Point of Quadrangle region
      • setLeftTop

        public void setLeftTop​(android.graphics.Point value)

        Gets left-top corner Point of Quadrangle region

        Value: A left-top corner Point of Quadrangle region
      • getRightTop

        public android.graphics.Point getRightTop()

        Gets right-top corner Point of Quadrangle region

        Value: A right-top corner Point of Quadrangle region
      • setRightTop

        public void setRightTop​(android.graphics.Point value)

        Gets right-top corner Point of Quadrangle region

        Value: A right-top corner Point of Quadrangle region
      • getRightBottom

        public android.graphics.Point getRightBottom()

        Gets right-bottom corner Point of Quadrangle region

        Value: A right-bottom corner Point of Quadrangle region
      • setRightBottom

        public void setRightBottom​(android.graphics.Point value)

        Gets right-bottom corner Point of Quadrangle region

        Value: A right-bottom corner Point of Quadrangle region
      • getLeftBottom

        public android.graphics.Point getLeftBottom()

        Gets left-bottom corner Point of Quadrangle region

        Value: A left-bottom corner Point of Quadrangle region
      • setLeftBottom

        public void setLeftBottom​(android.graphics.Point value)

        Gets left-bottom corner Point of Quadrangle region

        Value: A left-bottom corner Point of Quadrangle region
      • isEmpty

        public boolean isEmpty()

        Tests whether all Points of this Quadrangle have values of zero.

        Value: Returns <b>true</b> if all Points of this Quadrangle have values of zero; otherwise, <b>false</b>.
      • contains

        public boolean contains​(android.graphics.Point pt)

        Determines if the specified Point is contained within this Quadrangle class.

        Parameters:
        pt - The Point to test.
        Returns:
        Returns <b>true</b> if Point is contained within this Quadrangle class; otherwise, <b>false</b>.
      • contains

        public boolean contains​(int x,
                                int y)

        Determines if the specified point is contained within this Quadrangle class.

        Parameters:
        x - The x point cordinate.
        y - The y point cordinate.
        Returns:
        Returns <b>true</b> if point is contained within this Quadrangle class; otherwise, <b>false</b>.
      • contains

        public boolean contains​(Quadrangle quad)

        Determines if the specified Quadrangle is contained or intersect this Quadrangle class.

        Parameters:
        quad - The Quadrangle to test.
        Returns:
        Returns <b>true</b> if Quadrangle is contained or intersect this Quadrangle class; otherwise, <b>false</b>.
      • contains

        public boolean contains​(android.graphics.Rect rect)

        Determines if the specified Rectangle is contained or intersect this Quadrangle class.

        Parameters:
        rect - The Rectangle to test.
        Returns:
        Returns <b>true</b> if Rectangle is contained or intersect this Quadrangle class; otherwise, <b>false</b>.
      • equals

        public boolean equals​(java.lang.Object obj)

        Returns a value indicating whether this instance is equal to a specified Quadrangle value.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - An Quadrangle value to compare to this instance.
        Returns:
        <b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.
      • hashCode

        public int hashCode()

        Returns the hash code for this instance.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A 32-bit signed integer hash code.
      • toString

        public java.lang.String toString()

        Returns a human-readable string representation of this Quadrangle.

        Overrides:
        toString in class java.lang.Object
        Returns:
        A string that represents this Quadrangle.
      • getBoundingRectangle

        public android.graphics.Rect getBoundingRectangle()

        Creates Rectangle bounding this Quadrangle

        Returns:
        returns Rectangle bounding this Quadrangle
      • clone

        public Quadrangle clone()
        Overrides:
        clone in class java.lang.Object