public class LevelSet extends Object
Constructor and Description |
---|
LevelSet(int w,
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 |
---|---|
boolean |
add(Rect rect)
Returns true if the given rectangle was successfully added to
the LevelSet given its current dimensions, false if not.
|
boolean |
canExpand(Level level,
int height)
Indicates whether it's legal to trivially increase the height of
the given Level.
|
void |
clear()
Clears out all Levels stored in this LevelSet.
|
boolean |
compactAndAdd(Rect rect,
Object backingStore,
BackingStoreManager manager)
Allocates the given Rectangle, performing compaction of a Level
if necessary.
|
void |
expand(Level level,
int oldHeight,
int newHeight) |
int |
getUsedHeight()
Gets the used height of the levels in this LevelSet.
|
int |
h() |
Iterator<Level> |
iterator() |
boolean |
remove(Rect rect)
Removes the given Rect from this LevelSet.
|
void |
setHeight(int height)
Sets the height of this LevelSet.
|
void |
updateRectangleReferences()
Updates the references to the Rect objects in this LevelSet with
the "next locations" of those Rects.
|
float |
verticalFragmentationRatio()
Returns the vertical fragmentation ratio of this LevelSet.
|
void |
visit(RectVisitor visitor)
Visits all Rects contained in this LevelSet.
|
int |
w() |
public LevelSet(int w, int h)
public int w()
public int h()
public boolean add(Rect rect)
public boolean remove(Rect rect)
public boolean compactAndAdd(Rect rect, Object backingStore, BackingStoreManager manager)
add(Rect)
above. Returns true if allocated successfully, false
otherwise (indicating the need to expand the backing store).public boolean canExpand(Level level, int height)
public void expand(Level level, int oldHeight, int newHeight)
public int getUsedHeight()
public void setHeight(int height) throws IllegalArgumentException
IllegalArgumentException
public float verticalFragmentationRatio()
public void visit(RectVisitor visitor)
public void updateRectangleReferences()
public void clear()
Copyright 2010 JogAmp Community.