Class ExpressionCardinality


  • public final class ExpressionCardinality
    extends Expression
    Expression that successfully parses, if a given expression occurs or repeats with a specified cardinality. This class is immutable.
    Author:
    Tilman Kamp - Initial contribution
    • Constructor Detail

      • ExpressionCardinality

        public ExpressionCardinality​(Expression subExpression,
                                     boolean atLeastOne,
                                     boolean atMostOne)
        Constructs a new instance.
        Parameters:
        subExpression - expression that could occur or repeat
        atLeastOne - true, if expression should occur at least one time
        atMostOne - true, if expression should occur at most one time
    • Method Detail

      • getSubExpression

        public Expression getSubExpression()
        Returns:
        the subExpression
      • isAtLeastOne

        public boolean isAtLeastOne()
        Returns:
        the atLeastOne
      • isAtMostOne

        public boolean isAtMostOne()
        Returns:
        the atMostOne