org.inxar.syntacs.grammar.regular
Interface Union
- All Superinterfaces:
- Cloneable, RegularExpression
- All Known Implementing Classes:
- REUnion
- public interface Union
- extends RegularExpression
The Union
interface is an abstraction over the
RegularExpression
alternation object classically known
syntactically by the pipe '|'. An Union
is a discrete regular
expression that contains an arbitrary number of 'alternatives', any
of which if matched will satisfy the expression.
addAllele
public Union addAllele(RegularExpression e)
- Adds the given
RegularExpression
to the list of
alternatives. If the alternative is already in the set of
alternatives, no action is taken. This method returns the
Union
simply to support a coding style reminiscent
of java.lang.StringBuffer
.
getAlleles
public RegularExpression[] getAlleles()
- Returns the list of alternatives which are currently in the set
as an array.
alleles
public int alleles()
- Returns the number of alternatives.