com.tensegrity.composite.coordinate
Class CoordinateSystemPool

java.lang.Object
  extended bycom.tensegrity.composite.coordinate.CoordinateSystemPool

public final class CoordinateSystemPool
extends java.lang.Object

/**

Class CoordinateSystemPool defines the needed facility to pool created CoordinateSystem instances. This class is responsible for maintaining global references to CoordinateSystem objects needed by multiple clients.

This class has no public constructor. Use the static class methods directly.

While it is possible to remove all pooled CoordinateSystem objects by invoking the clear() method, this should only be done when you are sure that all pooled objects are no longer being referenced by any other object. The actual number of pooled CoordinateSystem objects can be determined by invoking the size() method. Additionally, the CoordinateSystemPool can parse a canonical description and return a new or existing CoordinateSystem when you invoke the parse(java.lang.String) method.

Version:
$Id: CoordinateSystemPool.java,v 1.7 2005/03/14 14:35:55 AndreasEbbert Exp $
Author:
MichaelKegel

Method Summary
static void clear()
          Removes all the pooled CoordinateSystems from the CoordinateSystemPool.
static void dump(java.io.PrintStream s)
          Dumps the CoordinateSystemPool to the PrintStream given by s.
static CoordinateSystem parse(java.lang.String description)
          Parses the canonical description of a CoordinateSystem given by description and pools a new instance if necessary.
static int size()
          Returns the number of the CoordinateSystems actually pooled in the CoordinateSystemPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static CoordinateSystem parse(java.lang.String description)
                              throws CoordinateSystemParseException
Parses the canonical description of a CoordinateSystem given by description and pools a new instance if necessary. The returned value is an instance of the CoordinateSystem that is described by description.

Parameters:
description - the canonical description of a CoordinateSystem
Returns:
CoordinateSystem the instance of the CoordinateSystem
Throws:
CoordinateSystemParseException - is thrown when an error occurs while parsing the canonical description of the CoordinateSystem

size

public static final int size()
Returns the number of the CoordinateSystems actually pooled in the CoordinateSystemPool.

Returns:
int the number of pooled CoordinateSystems

clear

public static final void clear()
Removes all the pooled CoordinateSystems from the CoordinateSystemPool. Notice that this only can be done when it is sure that the pooled CoordinateSystems are no longer referenced by any object. Otherwise these objects have a weak reference.


dump

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

Parameters:
s - the PrintStream to dump the CoordinateSystemPool to


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