Class ContainsAllMatcher
java.lang.Object
pl.decerto.hyperon.runtime.matcher.AbstractMatcher
pl.decerto.hyperon.runtime.matcher.AbstractSetMatcher
pl.decerto.hyperon.runtime.matcher.ContainsAllMatcher
- All Implemented Interfaces:
Matcher
Matcher treats [value] and [pattern] as sets. Checks if [value] contains all elements from [pattern].
Formally:p - set represented by [pattern] - pattern in matrix cell
v - set represented by [value] - input value for level (provided by levelCreator)
in - operator of concluding or equality for sets
Matcher returns the value of a logical sentence: p in v
- Author:
- przemek hertel
-
Field Summary
Fields inherited from class pl.decerto.hyperon.runtime.matcher.AbstractSetMatcher
DEFAULT_SEPARATOR, separator -
Method Summary
Modifier and TypeMethodDescription<T extends ValueHolder>
booleanChecks if the set represented by [value] contains all elements from the set represented by [pattern].booleanCheck if matcher is working in reverse state.voidsetReverse(boolean reverse) Sets matcher working state.Methods inherited from class pl.decerto.hyperon.runtime.matcher.AbstractSetMatcher
matches, normalize, split, toNormalizedSetMethods inherited from class pl.decerto.hyperon.runtime.matcher.AbstractMatcher
isBlank, isDefaultPattern
-
Method Details
-
isReverse
public boolean isReverse()Check if matcher is working in reverse state. What that means is that matcher swaps
andvalue
arguments inpatternMatcher.matches(String, String, Type)method- Returns:
- true if matcher is working in reverse state
-
setReverse
public void setReverse(boolean reverse) Sets matcher working state.- Parameters:
reverse- boolean telling whether matcher should work in reverse state.- See Also:
-
doMatches
Checks if the set represented by [value] contains all elements from the set represented by [pattern]. Argument [value] must be a file serialized to a string using the separator matcher uses.- Specified by:
doMatchesin classAbstractSetMatcher- Parameters:
value- serialized form of the setpattern- serialized form of the set in the cell - matching patterntype- cell type (level)
-