public interface ZList extends FigureSet
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)
f
- The figure to be inserted.void add(int index, Figure f)
Clients should assume that an implementation of this method does not check if the figure is already contained.
index
- The index at which the figure shall be inserted.f
- The figure to be inserted.void clear()
boolean contains(Figure f)
Figure get(int index)
index
- The given indexjava.lang.IndexOutOfBoundsException
- The index is out of range.java.awt.geom.Rectangle2D getBounds()
GeometricSet getContainedFigures(java.awt.geom.Rectangle2D region)
region
- The region.GeometricSet getIntersectedFigures(java.awt.geom.Rectangle2D region)
region
- The region.int indexOf(Figure f)
f
- The figure.void remove(Figure f)
f
- The figure.void remove(int index)
index
- The index of the figure.java.lang.IndexOutOfBoundsException
- The index is out of range.void set(int index, Figure f)
index
- The index of the figure.f
- The figurevoid 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.
index
- The index of the figure.f
- The figurejava.lang.IndexOutOfBoundsException
- The new index is out of range.int getFigureCount()