public class ThreadSafeQueryCollection extends Object implements QueryCollection
QueryCollection
implementation thread safe by synchronizing all behaviours.QueryCollection
Constructor and Description |
---|
ThreadSafeQueryCollection(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(String user) |
int |
getQueriesCount() |
Integer |
getQueryIndex(QueryContext query) |
boolean |
remove(QueryContext query)
removes given query from existing queries
|
boolean |
removeAll(Set<QueryContext> queries) |
public ThreadSafeQueryCollection(@NonNull QueryCollection queries)
public boolean add(QueryContext query)
MutableQueryCollection
add
in interface MutableQueryCollection
public boolean addAll(Set<QueryContext> queries)
addAll
in interface MutableQueryCollection
public boolean remove(QueryContext query)
MutableQueryCollection
remove
in interface MutableQueryCollection
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–2015 Apache Software Foundation. All rights reserved.