public class DefaultEstimatedQueryCollection extends Object implements EstimatedQueryCollection
EstimatedQueryCollection
Constructor and Description |
---|
DefaultEstimatedQueryCollection(QueryCollection queries) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(QueryContext query)
add the given query to existing queries
|
boolean |
addAll(Set<QueryContext> queries) |
Set<QueryContext> |
getQueries() |
Set<QueryContext> |
getQueries(LensDriver driver) |
Set<QueryContext> |
getQueries(String user) |
int |
getQueriesCount() |
int |
getQueriesCount(LensDriver driver) |
Integer |
getQueryIndex(QueryContext query) |
QueryCost |
getTotalQueryCost(String user)
Get total query cost of all queries of given user
|
boolean |
remove(QueryContext query)
removes given query from existing queries
|
boolean |
removeAll(Set<QueryContext> queries) |
String |
toString() |
public DefaultEstimatedQueryCollection(@NonNull QueryCollection queries)
public Set<QueryContext> getQueries(LensDriver driver)
getQueries
in interface EstimatedImmutableQueryCollection
driver
- Driver for which queries have to be returned.public int getQueriesCount(LensDriver driver)
getQueriesCount
in interface EstimatedImmutableQueryCollection
driver
- Driver for which count of queries have to be returned.public QueryCost getTotalQueryCost(String user)
EstimatedImmutableQueryCollection
getTotalQueryCost
in interface EstimatedImmutableQueryCollection
public boolean add(QueryContext query)
MutableQueryCollection
add
in interface MutableQueryCollection
query
- IllegalStateException
- if selected driver or selected driver query cost is not set for the querypublic boolean addAll(Set<QueryContext> queries)
addAll
in interface MutableQueryCollection
queries
- IllegalStateException
- if selected driver or selected driver query cost is not set for any of the queriespublic boolean remove(QueryContext query)
MutableQueryCollection
remove
in interface MutableQueryCollection
query
- public boolean removeAll(Set<QueryContext> queries)
removeAll
in interface MutableQueryCollection
public Set<QueryContext> getQueries()
getQueries
in interface ImmutableQueryCollection
public Set<QueryContext> getQueries(String user)
getQueries
in interface ImmutableQueryCollection
user
- User for whom queries have to be returned.public int getQueriesCount()
getQueriesCount
in interface ImmutableQueryCollection
public Integer getQueryIndex(QueryContext query)
getQueryIndex
in interface ImmutableQueryCollection
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.