Package ptolemy.actor.gt
Class GTIngredientList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<GTIngredient>
-
- ptolemy.actor.gt.GTIngredientList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<GTIngredient>
,java.util.Collection<GTIngredient>
,java.util.Deque<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$
- Author:
- Thomas Huining Feng
- See Also:
- Serialized Form
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
-
-
-
-
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 classjava.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.
-
-