ptolemy.domains.hde.lib
Class ArrayMemory

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.hde.lib.ArrayMemory
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TypedActor

public class ArrayMemory
extends TypedAtomicActor

Alter or Extract the ith element from an internal array. Read serial: read the ith element from the internal array and send it to the serial output port. Read parallel: read the entire array and send it to the parallel output port. Write serial: write the serial data input to the ith element of an internal array. Write parallel: write the parallel data input to the internal array. It is required that the value of the input index be less than or equal to the length parameter.

Version:
$Id: ArrayMemory.java,v 1.12 2004/04/13 03:33:17 cxh Exp $
Author:
Jim Armstrong
See Also:
LookupTable, RecordDisassembler, Serialized Form

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 TypedIOPort dataInParallel
          The parallel input data
 TypedIOPort dataInSerial
          The serial data input
 TypedIOPort dataOutParallel
          The parallel data output
 TypedIOPort dataOutSerial
          The serial data output
 TypedIOPort index
          The index into the input array.
 Parameter length
          The length of the input array.
 TypedIOPort read
          The read input
 TypedIOPort serialOrParallel
          The ser/par control for reading and writing
 TypedIOPort write
          The write input
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
ArrayMemory(CompositeEntity container, java.lang.String name)
          Construct an actor with the given container and name.
 
Method Summary
 void fire()
          If serialOrParallel = true: If read has a token, copy the ith element of the memory to dataOutSerial.
 void initialize()
          Get the value of the length parameter Initialize the memory array
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

index

public TypedIOPort index
The index into the input array. This is an integer that is required to be less than or equal to the length of the input array.


read

public TypedIOPort read
The read input


write

public TypedIOPort write
The write input


serialOrParallel

public TypedIOPort serialOrParallel
The ser/par control for reading and writing


dataInSerial

public TypedIOPort dataInSerial
The serial data input


dataOutSerial

public TypedIOPort dataOutSerial
The serial data output


dataOutParallel

public TypedIOPort dataOutParallel
The parallel data output


dataInParallel

public TypedIOPort dataInParallel
The parallel input data


length

public Parameter length
The length of the input array. This is an integer that defaults to 1;

Constructor Detail

ArrayMemory

public ArrayMemory(CompositeEntity container,
                   java.lang.String name)
            throws NameDuplicationException,
                   IllegalActionException
Construct an actor with the given container and name.

Parameters:
container - The container.
name - The name of this actor.
Throws:
IllegalActionException - If the actor cannot be contained by the proposed container.
NameDuplicationException - If the container already has an actor with this name.
Method Detail

initialize

public void initialize()
                throws IllegalActionException
Get the value of the length parameter Initialize the memory array

Specified by:
initialize in interface Executable
Overrides:
initialize in class AtomicActor
Throws:
IllegalActionException - If a derived class throws it.

fire

public void fire()
          throws IllegalActionException
If serialOrParallel = true: If read has a token, copy the ith element of the memory to dataOutSerial. If write has a token, copy the dataInSerial input to the ith element of memory. If serialOrParallel = false: If read has a token, copy the contents of the memory to dataOutParallel. If write has a token, copy the dataInParallel input to the memory.

Specified by:
fire in interface Executable
Overrides:
fire in class AtomicActor
Throws:
IllegalActionException - If the index input is out of range.