ptolemy.actor.gt
Class GraphMatcher.ParameterIterator

java.lang.Object
  extended by ptolemy.actor.gt.GraphAnalyzer
      extended by ptolemy.actor.gt.GraphMatcher.ParameterIterator
Enclosing class:
GraphMatcher

private class GraphMatcher.ParameterIterator
extends GraphAnalyzer

A class of objects used to iterate over all possible values of the value iterators (object in class ValueIterator) in a given composite entity.

Since:
Ptolemy II 7.1
Version:
$Id: GraphMatcher.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.actor.gt.GraphAnalyzer
GraphAnalyzer.IndexedList, GraphAnalyzer.IndexedLists, GraphAnalyzer.Path
 
Field Summary
private  boolean _firstTime
          Whether next() is invoked the first time
private  java.util.List<ValueIterator> _valueIterators
          The value iterators in the entity provided to the constructor.
 
Constructor Summary
GraphMatcher.ParameterIterator(ComponentEntity entity)
          Construct a parameter iterator for the given entity, so that all the value iterators in it are found, whose values will be iteratively tries.
 
Method Summary
private  void _computeNext()
          Compute the next set of values and store them in the value iterators.
protected  boolean _isOpaque(CompositeEntity entity)
          Return whether a composite entity is opaque.
protected  boolean _relationCollapsing(NamedObj container)
          Return whether multiple interconnected relations in the container should be collapsed and considered as one.
 boolean next()
          Set the values of value iterators in the composite entity with the next set of allowable values.
 
Methods inherited from class ptolemy.actor.gt.GraphAnalyzer
_isIgnored, findFirstChild, findFirstPath, findNextChild, findNextPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_firstTime

private boolean _firstTime
Whether next() is invoked the first time


_valueIterators

private java.util.List<ValueIterator> _valueIterators
The value iterators in the entity provided to the constructor.

Constructor Detail

GraphMatcher.ParameterIterator

GraphMatcher.ParameterIterator(ComponentEntity entity)
                         throws IllegalActionException
Construct a parameter iterator for the given entity, so that all the value iterators in it are found, whose values will be iteratively tries.

Parameters:
entity - The entity.
Throws:
IllegalActionException - If values of some value iterators cannot be retrieved.
Method Detail

next

public boolean next()
Set the values of value iterators in the composite entity with the next set of allowable values. The iterators are ordered by their names and each time, the last iterator's value is updated if its next is still acceptable. If not, the iterator before last is updated and the last iterator's value is reset to the beginning. This goes on until all possible value combinations are tries, at which time false is returned.

Returns:
Whether the next set of values has been set to the value iterators.

_isOpaque

protected boolean _isOpaque(CompositeEntity entity)
Return whether a composite entity is opaque.

Specified by:
_isOpaque in class GraphAnalyzer
Parameters:
entity - The entity to test.
Returns:
true if it is opaque; false otherwise.

_relationCollapsing

protected boolean _relationCollapsing(NamedObj container)
Return whether multiple interconnected relations in the container should be collapsed and considered as one.

Specified by:
_relationCollapsing in class GraphAnalyzer
Parameters:
container - The container.
Returns:
true if the relations should be collapsed.

_computeNext

private void _computeNext()
Compute the next set of values and store them in the value iterators.