protected class QueryElevationComponent.DefaultElevationProvider extends Object implements QueryElevationComponent.ElevationProvider
Modifier | Constructor and Description |
---|---|
protected |
DefaultElevationProvider(QueryElevationComponent.TrieSubsetMatcher.Builder<String,QueryElevationComponent.Elevation> subsetMatcherBuilder,
Map<QueryElevationComponent.ElevatingQuery,QueryElevationComponent.ElevationBuilder> elevationBuilderMap) |
Modifier and Type | Method and Description |
---|---|
QueryElevationComponent.Elevation |
getElevationForQuery(String queryString)
Gets the elevation associated to the provided query.
|
int |
size()
Gets the number of query elevations in this
QueryElevationComponent.ElevationProvider . |
protected DefaultElevationProvider(QueryElevationComponent.TrieSubsetMatcher.Builder<String,QueryElevationComponent.Elevation> subsetMatcherBuilder, Map<QueryElevationComponent.ElevatingQuery,QueryElevationComponent.ElevationBuilder> elevationBuilderMap)
subsetMatcherBuilder
- The QueryElevationComponent.TrieSubsetMatcher.Builder
to build the QueryElevationComponent.TrieSubsetMatcher
.elevationBuilderMap
- The map of elevation rules.public QueryElevationComponent.Elevation getElevationForQuery(String queryString)
QueryElevationComponent.ElevationProvider
By contract and by design, only one elevation may be associated to a given query (this can be safely verified by an assertion).
getElevationForQuery
in interface QueryElevationComponent.ElevationProvider
queryString
- The query string (not analyzed
yet,
this QueryElevationComponent.ElevationProvider
is in charge of analyzing it).null
if none.public int size()
QueryElevationComponent.ElevationProvider
QueryElevationComponent.ElevationProvider
.size
in interface QueryElevationComponent.ElevationProvider
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.