pythagoras.f

## Class Area

• All Implemented Interfaces:
Cloneable, IShape

```public class Area
extends Object
implements IShape, Cloneable```
• ### Constructor Summary

Constructors
Constructor and Description
`Area()`
Creates an empty area.
`Area(IShape s)`
Creates an area from the supplied shape.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` `add(Area area)`
Adds the supplied area to this area.
`Rectangle` `bounds()`
Returns a copy of the bounding rectangle for this shape.
`Rectangle` `bounds(Rectangle target)`
Initializes the supplied rectangle with this shape's bounding rectangle.
`Area` `clone()`
`boolean` ```contains(float x, float y)```
Returns true if this shape contains the specified point.
`boolean` ```contains(float x, float y, float width, float height)```
Returns true if this shape completely contains the specified rectangle.
`boolean` `contains(IRectangle r)`
Returns true if this shape completely contains the supplied rectangle.
`boolean` `contains(XY p)`
Returns true if this shape contains the supplied point.
`Area` `createTransformedArea(Transform t)`
Creates a new area equal to this area transformed by the supplied transform.
`boolean` `equals(Object obj)`
`void` `exclusiveOr(Area area)`
Computes the exclusive or of this area and the supplied area and sets this area to the result.
`void` `intersect(Area area)`
Intersects the supplied area with this area.
`boolean` ```intersects(float x, float y, float width, float height)```
Returns true if this shape intersects the specified rectangle.
`boolean` `intersects(IRectangle r)`
Returns true if this shape intersects the supplied rectangle.
`boolean` `isEmpty()`
Returns true if this shape encloses no area.
`boolean` `isPolygonal()`
Returns true if this area is polygonal.
`boolean` `isRectangular()`
Returns true if this area is rectangular.
`boolean` `isSingular()`
Returns true if this area encloses only a single contiguous space.
`PathIterator` `pathIterator(Transform t)`
Returns an iterator over the path described by this shape.
`PathIterator` ```pathIterator(Transform t, float flatness)```
Returns an iterator over the path described by this shape.
`void` `reset()`
Resets this area to empty.
`void` `subtract(Area area)`
Subtracts the supplied area from this area.
`String` `toString()`
`void` `transform(Transform t)`
Transforms this area with the supplied transform.
• ### Methods inherited from class java.lang.Object

`getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

• #### Area

`public Area()`
Creates an empty area.
• #### Area

`public Area(IShape s)`
Creates an area from the supplied shape.
• ### Method Detail

• #### isPolygonal

`public boolean isPolygonal()`
Returns true if this area is polygonal.
• #### isRectangular

`public boolean isRectangular()`
Returns true if this area is rectangular.
• #### isSingular

`public boolean isSingular()`
Returns true if this area encloses only a single contiguous space.
• #### reset

`public void reset()`
Resets this area to empty.
• #### transform

`public void transform(Transform t)`
Transforms this area with the supplied transform.
• #### createTransformedArea

`public Area createTransformedArea(Transform t)`
Creates a new area equal to this area transformed by the supplied transform.

`public void add(Area area)`
Adds the supplied area to this area.
• #### intersect

`public void intersect(Area area)`
Intersects the supplied area with this area.
• #### subtract

`public void subtract(Area area)`
Subtracts the supplied area from this area.
• #### exclusiveOr

`public void exclusiveOr(Area area)`
Computes the exclusive or of this area and the supplied area and sets this area to the result.
• #### isEmpty

`public boolean isEmpty()`
Description copied from interface: `IShape`
Returns true if this shape encloses no area.
Specified by:
`isEmpty` in interface `IShape`
• #### contains

```public boolean contains(float x,
float y)```
Description copied from interface: `IShape`
Returns true if this shape contains the specified point.
Specified by:
`contains` in interface `IShape`
• #### contains

```public boolean contains(float x,
float y,
float width,
float height)```
Description copied from interface: `IShape`
Returns true if this shape completely contains the specified rectangle.
Specified by:
`contains` in interface `IShape`
• #### contains

`public boolean contains(XY p)`
Description copied from interface: `IShape`
Returns true if this shape contains the supplied point.
Specified by:
`contains` in interface `IShape`
• #### contains

`public boolean contains(IRectangle r)`
Description copied from interface: `IShape`
Returns true if this shape completely contains the supplied rectangle.
Specified by:
`contains` in interface `IShape`
• #### intersects

```public boolean intersects(float x,
float y,
float width,
float height)```
Description copied from interface: `IShape`
Returns true if this shape intersects the specified rectangle.
Specified by:
`intersects` in interface `IShape`
• #### intersects

`public boolean intersects(IRectangle r)`
Description copied from interface: `IShape`
Returns true if this shape intersects the supplied rectangle.
Specified by:
`intersects` in interface `IShape`
• #### bounds

`public Rectangle bounds()`
Description copied from interface: `IShape`
Returns a copy of the bounding rectangle for this shape.
Specified by:
`bounds` in interface `IShape`
• #### bounds

`public Rectangle bounds(Rectangle target)`
Description copied from interface: `IShape`
Initializes the supplied rectangle with this shape's bounding rectangle.
Specified by:
`bounds` in interface `IShape`
Returns:
the supplied rectangle.
• #### pathIterator

`public PathIterator pathIterator(Transform t)`
Description copied from interface: `IShape`
Returns an iterator over the path described by this shape.
Specified by:
`pathIterator` in interface `IShape`
Parameters:
`t` - if supplied, the points in the path are transformed using this.
• #### pathIterator

```public PathIterator pathIterator(Transform t,
float flatness)```
Description copied from interface: `IShape`
Returns an iterator over the path described by this shape.
Specified by:
`pathIterator` in interface `IShape`
Parameters:
`t` - if supplied, the points in the path are transformed using this.
`flatness` - when approximating curved segments with lines, this controls the maximum distance the lines are allowed to deviate from the approximated curve, thus a higher flatness value generally allows for a path with fewer segments.
• #### equals

`public boolean equals(Object obj)`
Overrides:
`equals` in class `Object`
• #### clone

`public Area clone()`
Overrides:
`clone` in class `Object`
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`