Class LevelIndex<T>
java.lang.Object
io.higson.runtime.engine.core.index.LevelIndex<T>
- Type Parameters:
T- leaf type
Parameter index - tree structure for efficient parameter lookup.
- Author:
- Przemek Hertel
- Since:
- 1.0.0
- Version:
- 1.0.6
-
Constructor Summary
ConstructorsConstructorDescriptionLevelIndex(int levelCount) Create new empty index with default matchers and types.LevelIndex(int levelCount, Type<? extends ValueHolder>[] types, Matcher... matchers) LevelIndex(int levelCount, Type<? extends ValueHolder>[] types, Matcher[] matchers, boolean[] reverseMatchers) Create new empty index with parameter metadata. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd pattern along with returned value to index tree.getMatcher(int depth) getMatchMode(int depth) Type<? extends ValueHolder>getType(int depth) booleanisReverseMatcher(int depth) voidsetMatchModes(MatchMode... modes) voidsetUnion(boolean... union) voidtrim()Trims all leaf nodes.
-
Constructor Details
-
LevelIndex
public LevelIndex(int levelCount, Type<? extends ValueHolder>[] types, Matcher[] matchers, boolean[] reverseMatchers) Create new empty index with parameter metadata.- Parameters:
levelCount- number of input levels (depth)types- types defined in levelsmatchers- used matchers
-
LevelIndex
-
LevelIndex
public LevelIndex(int levelCount) Create new empty index with default matchers and types.- Parameters:
levelCount- depth
-
-
Method Details
-
add
Add pattern along with returned value to index tree.- Parameters:
levelValues- table with String valuesleaf- leaf value
-
find
-
find
-
trim
public void trim()Trims all leaf nodes. -
printTree
-
getMatcher
- Parameters:
depth- input level index, 0-based- Returns:
- matcher for given level depth.
-
getType
- Parameters:
depth- input level index, 0-based- Returns:
- type for given level depth.
-
isReverseMatcher
public boolean isReverseMatcher(int depth) - Parameters:
depth- input level index, 0-based- Returns:
- reverse-matcher flag for given level depth.
-
setUnion
public void setUnion(boolean... union) -
setMatchModes
-
getMatchMode
-
getAllKeys
-