|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Source
ptolemy.actor.lib.URLReader
ptolemy.actor.lib.URLDirectoryReader
This actor reads a URL and if the URL names a directory, it outputs the name of each file or subdirectory contained in the directory. If the URL names a file, then it outputs the name of that file.
If the repeat flag is true, then the sequence of file names is repeated indefinitely. If the refresh flag is true, and the repeat flag is true, then the directory is re-read before repeating the sequence of files and subdirectories.
If the endsWith String parameter is non-null and non-empty, then only file names or subdirectories that end with the value of the endsWith parameter are output.
One alternative implementation would be that if the URL named a file,
then the actor would output the names of the files and subdirectories
in the directory that contains the file.
Another alternative implementation would output the names of the
files and subdirectories in an array.
An extension would be to include a filter parameter that could be
a regular expression that would allow us to filter the file names.
Should this actor extend URLReader or SequenceActor?
| Red (liuj) |
| Red (liuj) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
ptolemy.kernel.Entity.ContainedObjectsIterator |
| Field Summary | |
ptolemy.data.expr.Parameter |
endsWith
Deprecated. If non-null and non-empty, then only output file names and sub directories that end with this String value. |
ptolemy.data.expr.Parameter |
repeat
Deprecated. Repeat after outputting all elements of the directory. |
| Fields inherited from class ptolemy.actor.lib.URLReader |
_reader, _refreshFlag, _source, _stdIn, refresh, sourceURL |
| Fields inherited from class ptolemy.actor.lib.Source |
output, trigger |
| 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 | |
URLDirectoryReader(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Deprecated. Construct an actor with the given container and name. |
|
| Method Summary | |
void |
attributeChanged(ptolemy.kernel.util.Attribute attribute)
Deprecated. If the specified attribute is URL, then close the current file (if there is one) and open the new one. |
void |
fire()
Deprecated. Output the data read in the prefire. |
void |
initialize()
Deprecated. Open the file at the URL, and set the width of the output. |
boolean |
postfire()
Deprecated. Update the iteration counter until it exceeds the number of elements in the directory. |
boolean |
prefire()
Deprecated. Read one row from the input and prepare for output them. |
| Methods inherited from class ptolemy.actor.lib.URLReader |
_setURLReader, wrapup |
| 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, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate |
| 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, 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, preinitialize, stop, stopFire, terminate |
| 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 |
public ptolemy.data.expr.Parameter endsWith
public ptolemy.data.expr.Parameter repeat
| Constructor Detail |
public URLDirectoryReader(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.IllegalActionException,
ptolemy.kernel.util.NameDuplicationException
container - The container.name - The name of this actor.
ptolemy.kernel.util.IllegalActionException - If the actor cannot be contained
by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an
actor with this name.| Method Detail |
public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
throws ptolemy.kernel.util.IllegalActionException
attributeChanged in class URLReaderattribute - The attribute that has changed.
ptolemy.kernel.util.IllegalActionException - If the specified attribute
is URL and the file cannot be opened.
public void fire()
throws ptolemy.kernel.util.IllegalActionException
fire in interface ptolemy.actor.Executablefire in class Sourceptolemy.kernel.util.IllegalActionException - If there's no director.
public void initialize()
throws ptolemy.kernel.util.IllegalActionException
initialize in interface ptolemy.actor.Executableinitialize in class URLReaderptolemy.kernel.util.IllegalActionException - Not thrown in this base class
public boolean postfire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the sourceURL is not valid.
public boolean prefire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the sourceURL is invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||