xtc.parser
Class OrderedChoice
java.lang.Object
xtc.tree.Node
xtc.parser.Element
xtc.parser.OrderedChoice
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.Object>, Locatable
public class OrderedChoice
- extends Element
An ordered choice of grammar elements.
- Version:
- $Revision: 1.14 $
- Author:
- Robert Grimm
|
Constructor Summary |
OrderedChoice()
Create a new ordered choice with no choices. |
OrderedChoice(Element element)
Create a new ordered choice with the specified element as its
only alternative. |
OrderedChoice(java.util.List<Sequence> alternatives)
Create a new ordered choice. |
| Methods inherited from class xtc.tree.Node |
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, getTokenText, hasLocation, hasName, hasProperty, hasTraversal, hasVariable, indexOf, isAnnotation, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, strip, toAnnotation, toList, toString, toToken, write |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
alternatives
public java.util.List<Sequence> alternatives
- The ordered list of sequences.
OrderedChoice
public OrderedChoice()
- Create a new ordered choice with no choices.
OrderedChoice
public OrderedChoice(java.util.List<Sequence> alternatives)
- Create a new ordered choice.
- Parameters:
alternatives - The list of alternatives.
OrderedChoice
public OrderedChoice(Element element)
- Create a new ordered choice with the specified element as its
only alternative. The constructor
ensures that the element is a sequence.
It also copies the element's location into the newly created
choice.
- Parameters:
element - The element.
tag
public Element.Tag tag()
- Description copied from class:
Element
- Get this element's tag.
- Specified by:
tag in class Element
- Returns:
- The tag.
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
Copyright © 2012. All Rights Reserved.