Class Expression.MinMax<E>
- java.lang.Object
-
- edu.washington.cs.knowitall.regex.Expression.MinMax<E>
-
- Type Parameters:
E
-
- All Implemented Interfaces:
com.google.common.base.Predicate<E>
,Expression<E>
,java.util.function.Predicate<E>
- Enclosing interface:
- Expression<E>
public static class Expression.MinMax<E> extends java.lang.Object implements Expression<E>
A minimum to maximum number of occurrences of the enclosed expression.<foo>{1,3}
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.washington.cs.knowitall.regex.Expression
Expression.AssertionExpression<E>, Expression.BaseExpression<E>, Expression.EndAssertion<E>, Expression.MatchingGroup<E>, Expression.MinMax<E>, Expression.NamedGroup<E>, Expression.NonMatchingGroup<E>, Expression.Option<E>, Expression.Or<E>, Expression.Plus<E>, Expression.Star<E>, Expression.StartAssertion<E>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Expression<E>
expr
(package private) int
maxOccurrences
(package private) int
minOccurrences
-
Constructor Summary
Constructors Constructor Description MinMax(Expression<E> expr, int minOccurrences, int maxOccurrences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
apply(E entity)
FiniteAutomaton.Automaton<E>
build()
Convert the expression into a NFA.int
minMatchingLength()
java.lang.String
toString()
-
-
-
Field Detail
-
expr
Expression<E> expr
-
minOccurrences
final int minOccurrences
-
maxOccurrences
final int maxOccurrences
-
-
Constructor Detail
-
MinMax
public MinMax(Expression<E> expr, int minOccurrences, int maxOccurrences)
- Parameters:
minOccurrences
- minimum occurrences, must be >= 0maxOccurrences
- maximum occurrences, must be >= 1 - you should prefer small values, as the use of large values will create a large automaton that takes a lot of memory
-
-
Method Detail
-
apply
public boolean apply(E entity)
- Specified by:
apply
in interfacecom.google.common.base.Predicate<E>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
build
public FiniteAutomaton.Automaton<E> build()
Convert the expression into a NFA.- Specified by:
build
in interfaceExpression<E>
-
minMatchingLength
public int minMatchingLength()
- Specified by:
minMatchingLength
in interfaceExpression<E>
-
-