com.tensegrity.generic.attribute
Class CustomAttributeGeneratorRegistry

java.lang.Object
  extended bycom.tensegrity.generic.attribute.CustomAttributeGeneratorRegistry

public final class CustomAttributeGeneratorRegistry
extends java.lang.Object

An object that maps keys to CustomAttributeGenerators. This registry cannot contain duplicate keys. Each key maps to at most one value.

Version:
$Id: CustomAttributeGeneratorRegistry.java,v 1.5 2005/08/02 14:10:43 BurkhardWick Exp $
Author:
MichaelKegel

Method Summary
static void clearRegistry()
          Removes all key-generator mappings from the registry
static boolean contains(java.lang.Object key)
          Returns true, if the registry contains a generator for the given key
static CustomAttributeGenerator getGenerator(java.lang.Object key)
          Returns the generator belonging to the given key.
static java.util.Iterator getKeys()
          Returns an iterator for the currently registered keys.
static void registerGenerator(java.lang.Object key, CustomAttributeGenerator generator)
          Registers the given generator for the given key.
static void unregisterGenerator(java.lang.Object key)
          Unregisters the generator for the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerGenerator

public static void registerGenerator(java.lang.Object key,
                                     CustomAttributeGenerator generator)
Registers the given generator for the given key.

Parameters:
key - the unique identifier.
generator - the generator to be used.

unregisterGenerator

public static void unregisterGenerator(java.lang.Object key)
Unregisters the generator for the given key.

Parameters:
key - the key for that to unregister the generator.

getGenerator

public static CustomAttributeGenerator getGenerator(java.lang.Object key)
Returns the generator belonging to the given key. Returns null, if the registry contains no mapping for this key.

Parameters:
key - the key whose associated generator is to be returned.
Returns:
the generator, to which the registry maps the specified key, or null, if there is no mapping for this key.

contains

public static boolean contains(java.lang.Object key)
Returns true, if the registry contains a generator for the given key

Parameters:
key - the key of the generator to look for
Returns:
true, if the registry contains a generator for the given key

getKeys

public static java.util.Iterator getKeys()
Returns an iterator for the currently registered keys.

Returns:
an Iterator for the registered keys.

clearRegistry

public static void clearRegistry()
Removes all key-generator mappings from the registry



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