Package org.smartparam.engine.core.index
Class LevelIndex<T>
java.lang.Object
org.smartparam.engine.core.index.LevelIndex<T>
- Type Parameters:
T- leaf type
Parameter index - tree structure for efficient parameter lookup.
- Since:
- 1.0.0
- Version:
- 1.0.6
- Author:
- Przemek Hertel
-
Constructor Summary
ConstructorsConstructorDescriptionLevelIndex(int levelCount) Create new empty index with default matchers and types.LevelIndex(int levelCount, Type<? extends ValueHolder>[] types, Matcher... matchers) 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) voidsetMatchModes(MatchMode... modes) voidsetUnion(boolean... union)
-
Constructor Details
-
LevelIndex
Create new empty index with parameter metadata.- Parameters:
levelCount- number of levels (depth)types- types defined in levelsmatchers- used matchers
-
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
-
printTree
-
getMatcher
- Parameters:
depth- size of matchers table- Returns:
- matcher for given level index.
-
getType
- Parameters:
depth- size of types table- Returns:
- type for given level index.
-
setUnion
public void setUnion(boolean... union) -
setMatchModes
-
getMatchMode
-