Package com.jogamp.nativewindow.util
Interface RectangleImmutable
-
- All Superinterfaces:
Comparable<RectangleImmutable>,WriteCloneable
- All Known Implementing Classes:
Rectangle
public interface RectangleImmutable extends WriteCloneable, Comparable<RectangleImmutable>
Immutable Rectangle interface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareTo(RectangleImmutable d)Compares square of size 1st, if equal the square of position.floatcoverage(RectangleImmutable r)Returns the coverage of given rectangle w/ this this one, i.e.booleanequals(Object obj)Checks whether two rect objects are equal.intgetHeight()intgetWidth()intgetX()intgetY()inthashCode()RectangleImmutableintersection(int rx1, int ry1, int rx2, int ry2)Returns the intersection of this rectangleand the given coordinates.RectangleImmutableintersection(RectangleImmutable r)Returns the intersection of this rectangleand the given rectangle.RectangleImmutableunion(int rx1, int ry1, int rx2, int ry2)Returns the union of this rectangleand the given coordinates.RectangleImmutableunion(RectangleImmutable r)Returns the union of this rectangle and the given rectangle.-
Methods inherited from interface com.jogamp.common.type.WriteCloneable
cloneMutable
-
-
-
-
Method Detail
-
getHeight
int getHeight()
-
getWidth
int getWidth()
-
getX
int getX()
-
getY
int getY()
-
union
RectangleImmutable union(RectangleImmutable r)
Returns the union of this rectangle and the given rectangle.
-
union
RectangleImmutable union(int rx1, int ry1, int rx2, int ry2)
Returns the union of this rectangleand the given coordinates.
-
intersection
RectangleImmutable intersection(RectangleImmutable r)
Returns the intersection of this rectangleand the given rectangle.
-
intersection
RectangleImmutable intersection(int rx1, int ry1, int rx2, int ry2)
Returns the intersection of this rectangleand the given coordinates.
-
coverage
float coverage(RectangleImmutable r)
Returns the coverage of given rectangle w/ this this one, i.e. between0.0and1.0.Coverage is computed by:
isect = this.intersection(r); coverage = area( isect ) / area( this ) ;
-
compareTo
int compareTo(RectangleImmutable d)
Compares square of size 1st, if equal the square of position.
- Specified by:
compareToin interfaceComparable<RectangleImmutable>
-
equals
boolean equals(Object obj)
Checks whether two rect objects are equal. Two instances ofRectangleare equal if the four integer values of the fieldsy,x,height, andwidthare all equal.
-
-