clarion.system
Class ActionCollection

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>
                  extended by clarion.system.AbstractOutputChunkCollection<AbstractAction>
                      extended by clarion.system.ActionCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,AbstractAction>

public class ActionCollection
extends AbstractOutputChunkCollection<AbstractAction>

This class implements an action collection within CLARION. It extends the AbstractOutputChunkCollection class.

Usage:

This class acts as a container for holding actions.

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

Field Summary
private  int hash
          The hash for this object.
private static long serialVersionUID
           
protected  boolean USE_DO_NOTHING_EXTERNAL
          The flag indicating whether or not the "DO_NOTHING_EXTERNAL" action should be returned by the getExternalActions methods.
protected  boolean USE_DO_NOTHING_GOAL
          The flag indicating whether or not the "DO_NOTHING_GOAL" action should be returned by the getGoalActions methods.
protected  boolean USE_DO_NOTHING_WM
          The flag indicating whether or not the "DO_NOTHING_WM" action should be returned by the getWMActions methods.
 
Constructor Summary
ActionCollection()
          Initializes an action collection.
ActionCollection(java.util.Collection<? extends AbstractAction> Actions)
          Initializes an action collection with the collection of actions specified.
ActionCollection(java.util.Map<? extends java.lang.Object,? extends AbstractAction> map)
          Initializes the action collection with the map of actions.
 
Method Summary
 ActionCollection clone()
          Clones the action collection (including all of the actions in the collection).
 boolean containsKeys(java.lang.Object ActCollection)
          Checks to see if the specified object is an action collection and that all of the keys within the specified action collection are specified within this collection.
 boolean equals(java.lang.Object ActCollection)
          Checks to see if the specified object is an action collection and that all of the actions within the specified action collection are equal to the actions in this collection.
 java.util.Collection<AbstractAction> getExternalActions()
          Gets the external actions in this collection.
 java.util.Collection<AbstractAction> getGoalActions()
          Gets the goal actions in this collection.
 java.util.Collection<AbstractAction> getWMActions()
          Gets the working memory actions in this collection.
 int hashCode()
           
 DimensionValueCollection toDimensionValueCollection()
          Returns the action collection as a dimension-value collection that contains a dimension for each unique dimension within the action of the action collection.
 
Methods inherited from class clarion.system.AbstractChunkCollection
put, putAll
 
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
toString
 
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, size, values
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

hash

private int hash
The hash for this object. When this item is cloned, so is this hash.


USE_DO_NOTHING_EXTERNAL

protected boolean USE_DO_NOTHING_EXTERNAL
The flag indicating whether or not the "DO_NOTHING_EXTERNAL" action should be returned by the getExternalActions methods. It is set to false by default and is turned on by the ACS only if the "DO_NOTHING_EXTERNAL" action is specified within either the output layer of an implicit module or a rule that is added to the ACS.


USE_DO_NOTHING_WM

protected boolean USE_DO_NOTHING_WM
The flag indicating whether or not the "DO_NOTHING_WM" action should be returned by the getWMActions methods. It is set to false by default and is turned on by the ACS only if the "DO_NOTHING_WM" action is specified within either the output layer of an implicit module or a rule that is added to the ACS.


USE_DO_NOTHING_GOAL

protected boolean USE_DO_NOTHING_GOAL
The flag indicating whether or not the "DO_NOTHING_GOAL" action should be returned by the getGoalActions methods. It is set to false by default and is turned on by the ACS only if the "DO_NOTHING_GOAL" action is specified within either the output layer of an implicit module or a rule that is added to the ACS.

Constructor Detail

ActionCollection

public ActionCollection()
Initializes an action collection.


ActionCollection

public ActionCollection(java.util.Collection<? extends AbstractAction> Actions)
Initializes an action collection with the collection of actions specified.

Parameters:
Actions - The actions for the collection.

ActionCollection

public ActionCollection(java.util.Map<? extends java.lang.Object,? extends AbstractAction> map)
Initializes the action collection with the map of actions.

Parameters:
map - The map of actions for the action collection.
Method Detail

getExternalActions

public java.util.Collection<AbstractAction> getExternalActions()
Gets the external actions in this collection.

Returns:
The external actions.

getWMActions

public java.util.Collection<AbstractAction> getWMActions()
Gets the working memory actions in this collection.

Returns:
The working memory actions.

getGoalActions

public java.util.Collection<AbstractAction> getGoalActions()
Gets the goal actions in this collection.

Returns:
The goal actions.

toDimensionValueCollection

public DimensionValueCollection toDimensionValueCollection()
Returns the action collection as a dimension-value collection that contains a dimension for each unique dimension within the action of the action collection. For all actions in the action collection that contain the same dimension, the values within that dimension will all be placed under a single dimension within the dimension-value collection that is returned.

This method is used to provide the actions to the subsystems in a format that can be used as input.

Specified by:
toDimensionValueCollection in class AbstractChunkCollection<AbstractAction>
Returns:
The action collection as a dimension-value collection.

containsKeys

public boolean containsKeys(java.lang.Object ActCollection)
Checks to see if the specified object is an action collection and that all of the keys within the specified action collection are specified within this collection.

Specified by:
containsKeys in class AbstractChunkCollection<AbstractAction>
Parameters:
ActCollection - The collection to compare to this collection.
Returns:
True if this collection contains all of the keys from the specified collection, otherwise false.

equals

public boolean equals(java.lang.Object ActCollection)
Checks to see if the specified object is an action collection and that all of the actions within the specified action collection are equal to the actions in this collection.

Specified by:
equals in interface java.util.Map<java.lang.Object,AbstractAction>
Specified by:
equals in class AbstractChunkCollection<AbstractAction>
Parameters:
ActCollection - The collection to compare to this collection.
Returns:
True if the two collections are equal, otherwise false.

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map<java.lang.Object,AbstractAction>
Overrides:
hashCode in class java.util.AbstractMap<java.lang.Object,AbstractAction>

clone

public ActionCollection clone()
Clones the action collection (including all of the actions in the collection).

Specified by:
clone in class AbstractOutputChunkCollection<AbstractAction>
Returns:
A copy of the action collection.