|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.utils.RectPool
public class RectPool
Pool of rectangle that can be allocated or freed.
Improves speed by avoiding garbage collection of rectangles that are used extensively by the toolkit.
Constructor Summary | |
---|---|
RectPool()
Creates a rectangle pool. |
Method Summary | |
---|---|
Rectangle2D.Float |
allocate()
Returns an available rectangle from the pool. |
static Rectangle2D.Float |
allocateRect()
Returns an available rectangle. |
Rectangle2D.Float |
copy(Rectangle2D rect)
Returns the copy of a specified rectangle. |
static Rectangle2D.Float |
copyRect(Rectangle2D rect)
Returns the copy of a specified rectangle. |
void |
free(Shape r)
Frees a shape, adding it back to the pool if it is a rectangle. |
static void |
freeRect(Shape r)
Frees a shape, adding it back to the pool if it is a rectangle. |
static RectPool |
getInstance()
Returns the current instance of the Rectangle pool. |
String |
getStatistics()
Returns statistics of use. |
boolean |
isDebugging()
Returns true if debugging the pool. |
boolean |
isEnabled()
Returns true if the pool manages rectangles. |
void |
reset()
Clears the whole pool. |
boolean |
setDebugging(boolean s)
Sets the debugging parameter. |
void |
setEnabled(boolean enabled)
Allow/disallow the pool to manage rectangles. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RectPool()
Method Detail |
---|
public static RectPool getInstance()
public static Rectangle2D.Float allocateRect()
public static Rectangle2D.Float copyRect(Rectangle2D rect)
rect
- the rectangle to copy
public static void freeRect(Shape r)
r
- the shapepublic Rectangle2D.Float allocate()
public Rectangle2D.Float copy(Rectangle2D rect)
rect
- the rectangle to copy
public void free(Shape r)
r
- the shapepublic boolean isDebugging()
public boolean setDebugging(boolean s)
s
- value of the parameter
public void reset()
public String getStatistics()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- set to true if the pool has to manage
rectangles, false otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |