jigcell.compare.data
Class DataGeneratorMap

java.lang.Object
  extended by jigcell.compare.data.DataGeneratorMap
All Implemented Interfaces:
IDataGeneratorCollection, IDataGeneratorMap

public class DataGeneratorMap
extends java.lang.Object
implements IDataGeneratorMap

Manages a map of data generators.

This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.

Author:
Nicholas Allen

Nested Class Summary
protected static class DataGeneratorMap.DataGeneratorMapDelegate
          Persists the mapping by using a series of put statements.
 
Nested classes/interfaces inherited from interface jigcell.compare.data.IDataGeneratorCollection
IDataGeneratorCollection.Key
 
Field Summary
protected  java.util.Map map
          Internal Map[Key,IDataGenerator] implementation
 
Constructor Summary
DataGeneratorMap()
          Creates a new map between names and data generators.
DataGeneratorMap(int size, float load)
          Creates a new map between names and data generators.
 
Method Summary
 java.lang.Object clone()
           
static IDataGeneratorMap createMap(java.lang.Object map)
          Converts a map to a map of data generators.
 IDataGenerator get(IDataGeneratorCollection.Key key)
          The generator associated with a particular key or null if there is no such mapping.
 java.util.Iterator iterator()
          An iterator over the entries of this map.
 IDataGenerator put(IDataGeneratorCollection.Key key, IDataGenerator generator)
          Adds a mapping between a key and generator.
 IDataGenerator put(java.lang.String name, java.lang.String id, IDataGenerator generator)
          Adds a mapping between a name, id, and generator.
 void putAll(java.util.Map map)
          Adds all the entries from the map to this map.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected java.util.Map map
Internal Map[Key,IDataGenerator] implementation

Constructor Detail

DataGeneratorMap

public DataGeneratorMap()
Creates a new map between names and data generators.


DataGeneratorMap

public DataGeneratorMap(int size,
                        float load)
Creates a new map between names and data generators.

Parameters:
size - Initial size
load - Load factor
Method Detail

createMap

public static IDataGeneratorMap createMap(java.lang.Object map)
Converts a map to a map of data generators. If the input is already the correct type, it may be returned unchanged.

Parameters:
map - Map

clone

public java.lang.Object clone()
Specified by:
clone in interface IDataGeneratorCollection
Overrides:
clone in class java.lang.Object

get

public IDataGenerator get(IDataGeneratorCollection.Key key)
The generator associated with a particular key or null if there is no such mapping.

Specified by:
get in interface IDataGeneratorMap
Parameters:
key - Key

iterator

public java.util.Iterator iterator()
An iterator over the entries of this map.

Specified by:
iterator in interface IDataGeneratorMap

put

public IDataGenerator put(IDataGeneratorCollection.Key key,
                          IDataGenerator generator)
Adds a mapping between a key and generator.

Specified by:
put in interface IDataGeneratorMap
Parameters:
key - Key
generator - Generator

put

public IDataGenerator put(java.lang.String name,
                          java.lang.String id,
                          IDataGenerator generator)
Adds a mapping between a name, id, and generator.

Specified by:
put in interface IDataGeneratorMap
Parameters:
name - Name
id - Id
generator - Generator

putAll

public void putAll(java.util.Map map)
Adds all the entries from the map to this map.

Specified by:
putAll in interface IDataGeneratorMap
Parameters:
map - Map

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object