clarion.system
Class 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,Dimension>
              extended by clarion.system.DimensionValueCollection
                  extended by clarion.system.AbstractChunk
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,Dimension>
Direct Known Subclasses:
AbstractOutputChunk

public abstract class AbstractChunk
extends DimensionValueCollection

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

Usage:

In it's most basic form, a chunk is essentially just a dimension-value collection that contains an ID. It is a representational object used most often by the top level of the various CLARION subsystems. In addition, some chunks may be linked to the output side of various explicit and implicit modules and can be used to pass pertinent information and instructions between the subsystems.

It is required that you specify a way of identifying the chunk (eg. name, number, etc) when you initialize this class. Once this ID is set, it cannot be changed. This ID is used as the key for this chunk when it is placed inside a map.

Known Subclasses:

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

Field Summary
private  java.lang.Object ID
          Identifies the chunk.
private static long serialVersionUID
           
 
Constructor Summary
AbstractChunk(java.lang.Object id)
          Initializes the chunk with the ID specified.
AbstractChunk(java.lang.Object id, java.util.Collection<? extends Dimension> dims)
          Initializes the chunk with the specified ID and dimensions.
AbstractChunk(java.lang.Object id, java.util.Map<? extends java.lang.Object,? extends Dimension> dims)
          Initializes the chunk with the specified ID and map of dimensions.
 
Method Summary
abstract  AbstractChunk clone()
          Clones the chunk (including all of it's dimensions).
 boolean equals(java.lang.Object chunk)
          Checks to see if the specified object is a chunk and if the ID of the specified chunk is the same as this chunk.
 boolean equalsID(java.lang.Object chunk)
          Checks to see if the specified chunk has the same ID as this chunk.
 java.lang.Object getID()
          Gets the ID of this chunk.
 java.lang.String toString()
           
 
Methods inherited from class clarion.system.DimensionValueCollection
containsKeys, getNumDVPairs, getValueCollection, hashCode, put, putAll, size
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
containsKey, entrySet, isEmpty, keySet, remove, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, isEmpty, keySet, remove, values
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ID

private java.lang.Object ID
Identifies the chunk. A name (in the form of a string) is simply one option for identifying a chunk.

Constructor Detail

AbstractChunk

public AbstractChunk(java.lang.Object id)
Initializes the chunk with the ID specified.

Parameters:
id - The ID of the chunk.

AbstractChunk

public AbstractChunk(java.lang.Object id,
                     java.util.Collection<? extends Dimension> dims)
Initializes the chunk with the specified ID and dimensions.

Parameters:
id - The ID of the chunk.
dims - The dimensions for the chunk.

AbstractChunk

public AbstractChunk(java.lang.Object id,
                     java.util.Map<? extends java.lang.Object,? extends Dimension> dims)
Initializes the chunk with the specified ID and map of dimensions.

Parameters:
id - The ID of the chunk.
dims - The map of dimensions for the chunk.
Method Detail

getID

public java.lang.Object getID()
Gets the ID of this chunk.

Returns:
The ID of this chunk.

equalsID

public boolean equalsID(java.lang.Object chunk)
Checks to see if the specified chunk has the same ID as this chunk.

Parameters:
chunk - The chunk whose ID you want to compare to this chunk's ID.
Returns:
True if the specified chunk has the same ID as this chunk, otherwise false.

equals

public boolean equals(java.lang.Object chunk)
Checks to see if the specified object is a chunk and if the ID of the specified chunk is the same as this chunk. It also checks to make sure all of the dimensions within the chunk are equal.

Specified by:
equals in interface java.util.Map<java.lang.Object,Dimension>
Overrides:
equals in class DimensionValueCollection
Parameters:
chunk - The object to compare to this chunk.
Returns:
True if the two chunks are equal, otherwise false.

clone

public abstract AbstractChunk clone()
Clones the chunk (including all of it's dimensions).

Overrides:
clone in class DimensionValueCollection
Returns:
A copy of the chunk.

toString

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