org.scijava.util
Class IntRect

java.lang.Object
  extended by org.scijava.util.IntRect

public class IntRect
extends Object

A class for representing a rectangular region, in integer coordinates.

It exists mainly to avoid AWT references to Rectangle.

Author:
Barry DeZonia

Field Summary
 int height
           
 int width
           
 int x
           
 int y
           
 
Constructor Summary
IntRect()
           
IntRect(int x, int y, int width, int height)
           
 
Method Summary
 boolean contains(IntCoords coords)
          Tests whether the given coordinates lie within the rectangle.
 boolean equals(Object o)
           
 IntCoords getBottomRight()
          Gets the bottom right coordinate of the rectangle.
 IntCoords getTopLeft()
          Gets the top left coordinate of the rectangle.
 int hashCode()
           
 IntRect intersection(IntRect r)
          Returns a Rect representing the intersection of this Rect with the given Rect.
 boolean intersects(IntRect r)
          Returns true if this rect intersects the given rect.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x

y

public int y

width

public int width

height

public int height
Constructor Detail

IntRect

public IntRect()

IntRect

public IntRect(int x,
               int y,
               int width,
               int height)
Method Detail

intersects

public boolean intersects(IntRect r)
Returns true if this rect intersects the given rect.


intersection

public IntRect intersection(IntRect r)
Returns a Rect representing the intersection of this Rect with the given Rect. If the two Rects do not intersect, the result is an empty Rect.


contains

public boolean contains(IntCoords coords)
Tests whether the given coordinates lie within the rectangle.


getTopLeft

public IntCoords getTopLeft()
Gets the top left coordinate of the rectangle.


getBottomRight

public IntCoords getBottomRight()
Gets the bottom right coordinate of the rectangle.


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009–2014 SciJava. All rights reserved.