Class SequencePattern<E>
java.lang.Object
ch.nolix.base.container.sequencesearch.SequencePattern<E>
- Type Parameters:
E- is the type of the elements of the sequences of aSequencePattern.
- All Implemented Interfaces:
ISequencePattern<E>
A
SequencePattern is not mutable.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SequencePattern<T> forElementType(Class<T> elementType) forNext(int count) IContainer<? extends IContainer<E>> getMatchingSequencesFrom(IContainer<E> list) intgetSize()booleanmatches(LinkedList<E> list) withConditionForNext(Predicate<E> condition) withConditionsForNexts(IContainer<Predicate<E>> conditions) withSequenceCondition(Predicate<IContainer<E>> sequenceCondition) Adds the given sequenceCondition to the currentISequencePattern.
-
Method Details
-
forElementType
- Type Parameters:
T-- Parameters:
elementType-- Returns:
- a new
SequencePatternfor the given elementType.
-
withBlankForNext
- Specified by:
withBlankForNextin interfaceISequencePattern<E>- Returns:
- a new
ISequencePatternfrom the currentISequencePatternwith a blank condition for the next element of the sequences of theISequencePattern.
-
withConditionForNext
- Specified by:
withConditionForNextin interfaceISequencePattern<E>- Parameters:
condition-- Returns:
- a new
ISequencePatternfrom the currentISequencePatternwith the given condition for the next element of the sequences of theISequencePattern.
-
withConditionsForNexts
- Specified by:
withConditionsForNextsin interfaceISequencePattern<E>- Parameters:
conditions-- Returns:
- a new
ISequencePatternfrom the currentISequencePatternwith the given conditions for the next elements of the sequences of theISequencePattern.
-
withSequenceCondition
Adds the given sequenceCondition to the currentISequencePattern.- Specified by:
withSequenceConditionin interfaceISequencePattern<E>- Parameters:
sequenceCondition-- Returns:
- a new
ISequencePatternfrom the currentISequencePatternwith the given sequenceCondition for the sequences theISequencePattern.
-
forNext
- Specified by:
forNextin interfaceISequencePattern<E>- Parameters:
count-- Returns:
- a new
ISequencePatternNextMediatorfor the currentISequencePatternand the given count.
-
getMatchingSequencesFrom
- Specified by:
getMatchingSequencesFromin interfaceISequencePattern<E>- Parameters:
list-- Returns:
- all sequences from the given container that match the current
ISequencePattern.
-
getSize
public int getSize()- Returns:
- the number of elements of the sequences of the current
SequencePattern.
-
matches
- Parameters:
list-- Returns:
- true if the current
SequencePatternmatches the given list, false otherwise.
-