public interface ZList extends FigureSet
Yellow |
Modifier and Type | Method and Description |
---|---|
void |
add(Figure f)
Add a figure to the list.
|
void |
add(int index,
Figure f)
Insert a figure at the given position.
|
void |
clear()
Removes all of the figures from this list.
|
boolean |
contains(Figure f)
Test if this list contains the given figure.
|
Figure |
get(int index)
Return the figure at the given index.
|
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of all the figures in this list.
|
GeometricSet |
getContainedFigures(java.awt.geom.Rectangle2D region)
Get the figures that are entirely contained by the given
region.
|
int |
getFigureCount()
Return the number of elements in this list.
|
GeometricSet |
getIntersectedFigures(java.awt.geom.Rectangle2D region)
Get the figures with bounding boxes that intersect the given
region.
|
int |
indexOf(Figure f)
Return the index of the given figure in the Z-list.
|
void |
remove(Figure f)
Remove the given figure from this list.
|
void |
remove(int index)
Remove the figure at the given index from this list.
|
void |
set(int index,
Figure f)
Replace the figure at the given index with the passed-in
figure.
|
void |
setIndex(int index,
Figure f)
Set the index of the given figure.
|
figures, figuresFromBack, figuresFromFront
void add(Figure f)
void add(int index, Figure f)
Clients should assume that an implementation of this method does not check if the figure is already contained.
void clear()
boolean contains(Figure f)
Figure get(int index)
java.lang.IndexOutOfBoundsException
- The index is out of range.java.awt.geom.Rectangle2D getBounds()
GeometricSet getContainedFigures(java.awt.geom.Rectangle2D region)
GeometricSet getIntersectedFigures(java.awt.geom.Rectangle2D region)
int indexOf(Figure f)
void remove(Figure f)
void remove(int index)
java.lang.IndexOutOfBoundsException
- The index is out of range.void set(int index, Figure f)
void setIndex(int index, Figure f)
Clients should assume that an implementation of this method does not check if the figure is already contained -- clients are therefore responsible for being bug-free.
java.lang.IndexOutOfBoundsException
- The new index is out of range.int getFigureCount()