com.tensegrity.composite.style
Class StyleItemPool

java.lang.Object
  extended bycom.tensegrity.composite.style.StyleItemPool

public class StyleItemPool
extends java.lang.Object

This class is a pool for StyleItem instances.

Version:
$Id: StyleItemPool.java,v 1.16 2005/12/12 15:20:46 MichaelKegel Exp $
Author:
MichaelKegel

Method Summary
static void clear()
          Clears the pool.
static void dump(java.io.PrintStream s)
          Dumps the pool to the PrintStream given by the parameter s.
static StyleItem get(java.lang.String name)
          Returns the pooled StyleItem stored under the given name.
static boolean isAvailable(java.lang.String name)
          Returns a boolean that indicates whether a StyleItem with the name given by name is in the pool or not.
static java.util.Set names()
          Method names returns a set the keys of the internal poolStyleItems map.
static void pool(StyleItem style)
          Pools the given StyleItem under it's name.
static StyleItem remove(java.lang.String name)
          Removes the StyleItem with the given name from the pool.
static int size()
          Returns the number of StyleItems in the pool.
static void useThreadLocal()
          A call to this method configures the StyleItemPool to make use of the ThreadLocal class hence a pool is created for each Thread the StyleItemPool is used by.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

useThreadLocal

public static final void useThreadLocal()
A call to this method configures the StyleItemPool to make use of the ThreadLocal class hence a pool is created for each Thread the StyleItemPool is used by.
Notice: This configuration must be done before the StyleItemPool is in use by any Thread.

See Also:
ThreadLocal

isAvailable

public static final boolean isAvailable(java.lang.String name)
Returns a boolean that indicates whether a StyleItem with the name given by name is in the pool or not.

Parameters:
name - the mame of the StyleItem to check
Returns:
boolean flag that indicates whether a StyleItem with the given name is avaiable or not

get

public static final StyleItem get(java.lang.String name)
Returns the pooled StyleItem stored under the given name.

Parameters:
name - the name of the StyleItem to look up.
Returns:
the looked up StyleItem; null if no such item exists within this pool.

remove

public static final StyleItem remove(java.lang.String name)
Removes the StyleItem with the given name from the pool.

Parameters:
name - the name of the StyleItem to remove.
Returns:
the removed StyleItem;null if no StyleItem was found.

pool

public static final void pool(StyleItem style)
Pools the given StyleItem under it's name.

Parameters:
style - the StyleItem to pool.

size

public static final int size()
Returns the number of StyleItems in the pool.

Returns:
int the count of pooled StyleItem objects

names

public static final java.util.Set names()
Method names returns a set the keys of the internal poolStyleItems map.

Returns:
Set the Set with all names of the currently pooled GeometryDescriptor instances.

clear

public static final void clear()
Clears the pool.


dump

public static final void dump(java.io.PrintStream s)
Dumps the pool to the PrintStream given by the parameter s.

Parameters:
s - the PrintStream to dump the pool to


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.