| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final List | |
| private int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | LevelSet(final int w, final int h)
A LevelSet manages all of the backing store for a region of a specified width and height. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public boolean | |
| public void | |
| public boolean | compactAndAdd(final Rect rect, final Object backingStore, final BackingStoreManager manager)
Allocates the given Rectangle, performing compaction of a Level if necessary. |
| public void | |
| public int | |
| public int | |
| public Iterator | |
| public boolean | |
| public void | |
| public void | updateRectangleReferences()
Updates the references to the Rect objects in this LevelSet with the "next locations" of those Rects. |
| public float | |
| public void | |
| public int |
| h | back to summary |
|---|---|
| private int h | |
| levels | back to summary |
|---|---|
| private final List<Level> levels | |
| nextAddY | back to summary |
|---|---|
| private int nextAddY | |
| w | back to summary |
|---|---|
| private final int w | |
| LevelSet | back to summary |
|---|---|
| public LevelSet(final int w, final int h) A LevelSet manages all of the backing store for a region of a specified width and height. | |
| add | back to summary |
|---|---|
| public boolean add(final Rect rect) Returns true if the given rectangle was successfully added to the LevelSet given its current dimensions, false if not. Caller is responsible for performing compaction, expansion, etc. as a consequence. | |
| canExpand | back to summary |
|---|---|
| public boolean canExpand(final Level level, final int height) Indicates whether it's legal to trivially increase the height of the given Level. This is only possible if it's the last Level added and there's enough room in the backing store. | |
| clear | back to summary |
|---|---|
| public void clear() Clears out all Levels stored in this LevelSet. | |
| compactAndAdd | back to summary |
|---|---|
| public boolean compactAndAdd(final Rect rect, final Object backingStore, final BackingStoreManager manager) Allocates the given Rectangle, performing compaction of a Level
if necessary. This is the correct fallback path to | |
| expand | back to summary |
|---|---|
| public void expand(final Level level, final int oldHeight, final int newHeight) | |
| getUsedHeight | back to summary |
|---|---|
| public int getUsedHeight() Gets the used height of the levels in this LevelSet. | |
| h | back to summary |
|---|---|
| public int h() | |
| iterator | back to summary |
|---|---|
| public Iterator | |
| remove | back to summary |
|---|---|
| public boolean remove(final Rect rect) Removes the given Rect from this LevelSet. | |
| setHeight | back to summary |
|---|---|
| public void setHeight(final int height) throws IllegalArgumentException Sets the height of this LevelSet. It is only legal to reduce the height to greater than or equal to the currently used height. | |
| updateRectangleReferences | back to summary |
|---|---|
| public void updateRectangleReferences() Updates the references to the Rect objects in this LevelSet with the "next locations" of those Rects. This is actually used to update the new Rects in a newly laid-out LevelSet with the original Rects. | |
| verticalFragmentationRatio | back to summary |
|---|---|
| public float verticalFragmentationRatio() Returns the vertical fragmentation ratio of this LevelSet. This is defined as the ratio of the sum of the heights of all completely empty Levels divided by the overall used height of the LevelSet. A high vertical fragmentation ratio indicates that it may be profitable to perform a compaction. | |
| visit | back to summary |
|---|---|
| public void visit(final RectVisitor visitor) Visits all Rects contained in this LevelSet. | |
| w | back to summary |
|---|---|
| public int w() | |