clarion.system
Class DriveCollection

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,Drive>
              extended by clarion.system.DriveCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,Drive>
Direct Known Subclasses:
BehavioralApproachSystem, BehavioralInhibitionSystem, NeitherBehavioralSystem

public class DriveCollection
extends java.util.LinkedHashMap<java.lang.Object,Drive>

This class implements a drive collection within CLARION. It extends the LinkedHashMap class.

Usage:

This class acts as a container to hold drives.

Known Subclasses:

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

Field Summary
private static long serialVersionUID
           
 
Constructor Summary
DriveCollection()
          Initializes a drive collection with a default initial capacity and load factor.
DriveCollection(java.util.Collection<? extends Drive> drives)
          Initializes the drive collection with the collection of drives specified.
DriveCollection(java.util.Map<? extends java.lang.Object,? extends Drive> map)
          Initializes the drive collection with the map of drives.
 
Method Summary
 DriveStrengthCollection getDriveStrengths()
          Gets the drive strength objects associated with the drives in this drive collection.
 Drive put(java.lang.Object key, Drive drive)
          Puts a drive in the drive collection.
 void putAll(java.util.Map<? extends java.lang.Object,? extends Drive> drives)
          Puts a collection of drives in the drive collection.
 int size()
          Returns the number of drives in the drive collection.
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, remove, values
 
Methods inherited from class java.util.AbstractMap
equals, 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, equals, hashCode, isEmpty, keySet, remove, values
 

Field Detail

serialVersionUID

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

DriveCollection

public DriveCollection()
Initializes a drive collection with a default initial capacity and load factor.


DriveCollection

public DriveCollection(java.util.Collection<? extends Drive> drives)
Initializes the drive collection with the collection of drives specified.

Parameters:
drives - The drives for the collection.

DriveCollection

public DriveCollection(java.util.Map<? extends java.lang.Object,? extends Drive> map)
Initializes the drive collection with the map of drives.

Parameters:
map - The map of drives for the drive collection.
Method Detail

getDriveStrengths

public DriveStrengthCollection getDriveStrengths()
Gets the drive strength objects associated with the drives in this drive collection.

Returns:
A collection of drive strength objects associated with the drives in this drive collection.

put

public Drive put(java.lang.Object key,
                 Drive drive)
          throws java.lang.IllegalArgumentException
Puts a drive in the drive collection. If this drive is already in the drive collection, this method will throw an exception.

Specified by:
put in interface java.util.Map<java.lang.Object,Drive>
Overrides:
put in class java.util.HashMap<java.lang.Object,Drive>
Parameters:
drive - The drive to add.
Returns:
The result of putting the drive in the drive collection. This will always return null (meaning the drive did not previously exist in the map). This is because you are not allowed to put a drive into a drive collection that already contains that drive.
Throws:
java.lang.IllegalArgumentException - If the drive is already in the drive collection.

putAll

public void putAll(java.util.Map<? extends java.lang.Object,? extends Drive> drives)
Puts a collection of drives in the drive collection. If any drives are already in the drive collection, an exception will be thrown.

Specified by:
putAll in interface java.util.Map<java.lang.Object,Drive>
Overrides:
putAll in class java.util.HashMap<java.lang.Object,Drive>
Parameters:
drives - The drives to add.

size

public int size()
Returns the number of drives in the drive collection.

Specified by:
size in interface java.util.Map<java.lang.Object,Drive>
Overrides:
size in class java.util.HashMap<java.lang.Object,Drive>