ptolemy.actor.gt
Class GTIngredientList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<GTIngredient>
                  extended by ptolemy.actor.gt.GTIngredientList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<GTIngredient>, java.util.Collection<GTIngredient>, java.util.List<GTIngredient>, java.util.Queue<GTIngredient>

public class GTIngredientList
extends java.util.LinkedList<GTIngredient>

A list of GTIngredients. Such a list is contained in a GTIngredientsAttribute, which is associated with special entities in a transformation rule, such as AtomicActorMatcher and CompositeActorMatcher. GTIngredients in this list are either all criteria or all operations.

Since:
Ptolemy II 7.1
Version:
$Id: GTIngredientList.java 54815 2009-06-30 05:18:27Z tfeng $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Field Summary
private  GTIngredientsAttribute _owner
          The attribute that contain this list of ingredients.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
GTIngredientList(GTIngredientsAttribute owner)
          Construct an empty GTIngredientList contained by the given attribute.
GTIngredientList(GTIngredientsAttribute owner, GTIngredient... ingredients)
          Construct a GTIngredientList contained by the given attribute with some initial ingredients.
GTIngredientList(GTIngredientsAttribute owner, GTIngredientList template)
          Construct a GTIngredientList contained by the given attribute, and add all the ingredients in the template to this one.
 
Method Summary
 GTIngredientsAttribute getOwner()
          Get the GTIngredientsAttribute that contain this list.
static GTIngredientList parse(GTIngredientsAttribute owner, java.lang.String expression)
          Parse the given expression and construct a GTIngredientList in the given GTIngredientsAttribute.
 java.lang.String toString()
          Return a string that describes all the ingredients within this list.
 void validate()
          Check validity of the contained ingredients.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Field Detail

_owner

private GTIngredientsAttribute _owner
The attribute that contain this list of ingredients.

Constructor Detail

GTIngredientList

public GTIngredientList(GTIngredientsAttribute owner)
Construct an empty GTIngredientList contained by the given attribute.

Parameters:
owner - The attribute that contains this list of ingredients.

GTIngredientList

public GTIngredientList(GTIngredientsAttribute owner,
                        GTIngredient... ingredients)
Construct a GTIngredientList contained by the given attribute with some initial ingredients.

Parameters:
owner - The attribute that contains this list of ingredients.
ingredients - The initial ingredients, which should be all criteria or all operations.

GTIngredientList

public GTIngredientList(GTIngredientsAttribute owner,
                        GTIngredientList template)
Construct a GTIngredientList contained by the given attribute, and add all the ingredients in the template to this one.

Parameters:
owner - The attribute that contains this list of ingredients.
template - Another GTIngredientList whose ingredients are to be added to this one. The references of those ingredients are copied. No cloning is done.
Method Detail

getOwner

public GTIngredientsAttribute getOwner()
Get the GTIngredientsAttribute that contain this list.

Returns:
The GTIngredientsAttribute that contain this list.

parse

public static GTIngredientList parse(GTIngredientsAttribute owner,
                                     java.lang.String expression)
                              throws MalformedStringException
Parse the given expression and construct a GTIngredientList in the given GTIngredientsAttribute.

Parameters:
owner - The attribute that contains the constructed list.
expression - The expression to parse.
Returns:
The constructed list.
Throws:
MalformedStringException - If the expression is malformed.

toString

public java.lang.String toString()
Return a string that describes all the ingredients within this list.

Overrides:
toString in class java.util.AbstractCollection<GTIngredient>
Returns:
The string that describes all the ingredients within this list.

validate

public void validate()
              throws ValidationException
Check validity of the contained ingredients.

Throws:
ValidationException - If some ingredients are invalid.