clarion.system
Class AbstractChunkCollection<C extends AbstractChunk>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<java.lang.Object,C>
              extended by clarion.system.AbstractChunkCollection<C>
Type Parameters:
C - The type of chunk being placed in the collection.
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,C>
Direct Known Subclasses:
AbstractOutputChunkCollection, SpecializedWMChunkCollection

public abstract class AbstractChunkCollection<C extends AbstractChunk>
extends java.util.LinkedHashMap<java.lang.Object,C>

This class implements a chunk collection within CLARION. It extends the LinkedHashMap class. This class is abstract and therefore cannot be instantiated on its own.

Usage:

This class acts as a container to hold chunks of the specified type .

Known Subclasses:

Version:
6.0.4
Author:
Nick Wilson
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Constructor Summary
AbstractChunkCollection()
          Initializes a chunk collection.
AbstractChunkCollection(java.util.Collection<? extends C> chunks)
          Initializes a chunk collection with the collection of chunks specified.
AbstractChunkCollection(java.util.Map<? extends java.lang.Object,? extends C> map)
          Initializes the chunk collection with the map of chunks.
 
Method Summary
abstract  AbstractChunkCollection<? extends C> clone()
           
abstract  boolean containsKeys(java.lang.Object ChCollection)
           
abstract  boolean equals(java.lang.Object ChCollection)
           
 C put(java.lang.Object key, C chunk)
          Puts the chunk into the chunk collection as long as the chunk is not already in the chunk collection.
 void putAll(java.util.Map<? extends java.lang.Object,? extends C> map)
          Puts all of the chunks in the map into the chunk collection as long as the chunks are not already in the chunk collection.
abstract  DimensionValueCollection toDimensionValueCollection()
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
containsKey, entrySet, isEmpty, keySet, remove, size, values
 
Methods inherited from class java.util.AbstractMap
hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, hashCode, isEmpty, keySet, remove, size, values
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

AbstractChunkCollection

public AbstractChunkCollection()
Initializes a chunk collection.


AbstractChunkCollection

public AbstractChunkCollection(java.util.Collection<? extends C> chunks)
Initializes a chunk collection with the collection of chunks specified.

Parameters:
chunks - The chunks for the collection.

AbstractChunkCollection

public AbstractChunkCollection(java.util.Map<? extends java.lang.Object,? extends C> map)
Initializes the chunk collection with the map of chunks.

Parameters:
map - The map of chunks for the chunk collection.
Method Detail

put

public C put(java.lang.Object key,
             C chunk)
                            throws java.lang.IllegalArgumentException
Puts the chunk into the chunk collection as long as the chunk is not already in the chunk collection. If the chunk is already in the chunk collection, this method throws an exception. If the specified key is not the ID of the specified chunk, this method throws an exception.

Specified by:
put in interface java.util.Map<java.lang.Object,C extends AbstractChunk>
Overrides:
put in class java.util.HashMap<java.lang.Object,C extends AbstractChunk>
Parameters:
key - The key with which the specified chunk is to be associated. This MUST be the ID of the specified chunk.
chunk - The chunk to add to the chunk collection.
Returns:
The result of putting the chunk in the chunk collection. This will always return null (meaning the chunk did not previously exist in the map). This is because you are not allowed to put a chunk into a chunk collection that already contains that chunk.
Throws:
java.lang.IllegalArgumentException - If the chunk is already in the chunk collection or the specified key is not the ID of the specified chunk.

putAll

public void putAll(java.util.Map<? extends java.lang.Object,? extends C> map)
Puts all of the chunks in the map into the chunk collection as long as the chunks are not already in the chunk collection.

Specified by:
putAll in interface java.util.Map<java.lang.Object,C extends AbstractChunk>
Overrides:
putAll in class java.util.HashMap<java.lang.Object,C extends AbstractChunk>
Parameters:
map - The map of chunks to add.

toDimensionValueCollection

public abstract DimensionValueCollection toDimensionValueCollection()

equals

public abstract boolean equals(java.lang.Object ChCollection)
Specified by:
equals in interface java.util.Map<java.lang.Object,C extends AbstractChunk>
Overrides:
equals in class java.util.AbstractMap<java.lang.Object,C extends AbstractChunk>

containsKeys

public abstract boolean containsKeys(java.lang.Object ChCollection)

clone

public abstract AbstractChunkCollection<? extends C> clone()
Overrides:
clone in class java.util.HashMap<java.lang.Object,C extends AbstractChunk>