public class SearchableCollectionDefault<KEY,ITEM> extends Object implements SearchableCollection<KEY,ITEM>, SearchableCollectionComposer
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,FieldAccess> |
fields |
protected Filter |
filter |
protected Set<LookupIndex> |
indexes |
protected Map<String,LookupIndex> |
lookupIndexMap |
protected UniqueLookupIndex<KEY,ITEM> |
primaryIndex |
protected Function<ITEM,KEY> |
primaryKeyGetter |
protected String |
primaryKeyName |
protected boolean |
removeDuplication |
protected Map<String,SearchIndex> |
searchIndexMap |
| Constructor and Description |
|---|
SearchableCollectionDefault() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ITEM item) |
boolean |
addAll(Collection<? extends ITEM> items) |
void |
addLookupIndex(String name,
LookupIndex si) |
void |
addSearchIndex(String name,
SearchIndex si) |
List<ITEM> |
all() |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
int |
count(KEY key,
String property,
byte value) |
int |
count(KEY key,
String property,
char value) |
int |
count(KEY key,
String property,
double value) |
int |
count(KEY key,
String property,
float value) |
int |
count(KEY key,
String property,
int value) |
int |
count(KEY key,
String property,
long value) |
int |
count(KEY key,
String property,
Object value) |
int |
count(KEY key,
String property,
short value) |
boolean |
delete(ITEM item) |
ITEM |
get(KEY key) |
KEY |
getKey(ITEM item) |
void |
init() |
void |
invalidateIndex(String property,
ITEM item) |
boolean |
isEmpty() |
Iterator<ITEM> |
iterator() |
<T> T |
max(KEY key,
String property,
Class<T> type) |
double |
maxDouble(KEY key,
String property) |
int |
maxInt(KEY key,
String property) |
long |
maxLong(KEY key,
String property) |
Number |
maxNumber(KEY key,
String property) |
String |
maxString(KEY key,
String property) |
<T> T |
min(KEY key,
String property,
Class<T> type) |
double |
minDouble(KEY key,
String property) |
int |
minInt(KEY key,
String property) |
long |
minLong(KEY key,
String property) |
Number |
minNumber(KEY key,
String property) |
String |
minString(KEY key,
String property) |
List<ITEM> |
query(Criteria... expressions) |
List<ITEM> |
query(List<Criteria> expressions) |
List<Map<String,Object>> |
query(List<Selector> selectors,
Criteria... expressions) |
void |
query(Visitor<KEY,ITEM> visitor,
Criteria... expressions) |
List<Map<String,Object>> |
queryAsMaps(Criteria... expressions) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> items) |
void |
removeByKey(KEY key) |
ResultSet<ITEM> |
results(Criteria... expressions) |
boolean |
retainAll(Collection<?> c) |
void |
setFields(Map<String,FieldAccess> fields) |
void |
setFilter(Filter filter) |
void |
setPrimaryKeyGetter(Function getter) |
void |
setPrimaryKeyName(String primaryKey) |
void |
setRemoveDuplication(boolean removeDuplication) |
int |
size() |
List<ITEM> |
sortedQuery(Sort sortBy,
Criteria... expressions) |
List<Map<String,Object>> |
sortedQuery(Sort sortBy,
List<Selector> selectors,
Criteria... expressions) |
List<ITEM> |
sortedQuery(String sortBy,
Criteria... expressions) |
List<Map<String,Object>> |
sortedQuery(String sortBy,
List<Selector> selectors,
Criteria... expressions) |
void |
sortedQuery(Visitor<KEY,ITEM> visitor,
Sort sortBy,
Criteria... expressions) |
void |
sortedQuery(Visitor<KEY,ITEM> visitor,
String sortBy,
Criteria... expressions) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
Collection<ITEM> |
toCollection() |
void |
validateIndex(String property,
ITEM item) |
void |
validateIndexes(ITEM item) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCodeprotected Map<String,LookupIndex> lookupIndexMap
protected Map<String,SearchIndex> searchIndexMap
protected Set<LookupIndex> indexes
protected Filter filter
protected Map<String,FieldAccess> fields
protected UniqueLookupIndex<KEY,ITEM> primaryIndex
protected String primaryKeyName
protected boolean removeDuplication
public boolean delete(ITEM item)
delete in interface SearchableCollection<KEY,ITEM>public boolean add(ITEM item)
add in interface Collection<ITEM>public void validateIndexes(ITEM item)
validateIndexes in interface SearchableCollection<KEY,ITEM>public KEY getKey(ITEM item)
getKey in interface SearchableCollection<KEY,ITEM>public void setRemoveDuplication(boolean removeDuplication)
setRemoveDuplication in interface SearchableCollectionComposerpublic int count(KEY key, String property, int value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, short value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, byte value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, long value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, char value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, float value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, double value)
count in interface SearchableCollection<KEY,ITEM>public int count(KEY key, String property, Object value)
count in interface SearchableCollection<KEY,ITEM>public <T> T max(KEY key, String property, Class<T> type)
max in interface SearchableCollection<KEY,ITEM>public String maxString(KEY key, String property)
maxString in interface SearchableCollection<KEY,ITEM>public Number maxNumber(KEY key, String property)
maxNumber in interface SearchableCollection<KEY,ITEM>public int maxInt(KEY key, String property)
maxInt in interface SearchableCollection<KEY,ITEM>public long maxLong(KEY key, String property)
maxLong in interface SearchableCollection<KEY,ITEM>public double maxDouble(KEY key, String property)
maxDouble in interface SearchableCollection<KEY,ITEM>public <T> T min(KEY key, String property, Class<T> type)
min in interface SearchableCollection<KEY,ITEM>public String minString(KEY key, String property)
minString in interface SearchableCollection<KEY,ITEM>public Number minNumber(KEY key, String property)
minNumber in interface SearchableCollection<KEY,ITEM>public int minInt(KEY key, String property)
minInt in interface SearchableCollection<KEY,ITEM>public long minLong(KEY key, String property)
minLong in interface SearchableCollection<KEY,ITEM>public double minDouble(KEY key, String property)
minDouble in interface SearchableCollection<KEY,ITEM>public ResultSet<ITEM> results(Criteria... expressions)
results in interface SearchableCollection<KEY,ITEM>public List<ITEM> query(Criteria... expressions)
query in interface SearchableCollection<KEY,ITEM>public List<ITEM> query(List<Criteria> expressions)
query in interface SearchableCollection<KEY,ITEM>public List<ITEM> sortedQuery(String sortBy, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public List<ITEM> sortedQuery(Sort sortBy, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public List<Map<String,Object>> queryAsMaps(Criteria... expressions)
queryAsMaps in interface SearchableCollection<KEY,ITEM>public List<Map<String,Object>> sortedQuery(String sortBy, List<Selector> selectors, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public List<Map<String,Object>> sortedQuery(Sort sortBy, List<Selector> selectors, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public void query(Visitor<KEY,ITEM> visitor, Criteria... expressions)
query in interface SearchableCollection<KEY,ITEM>public void sortedQuery(Visitor<KEY,ITEM> visitor, String sortBy, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public void sortedQuery(Visitor<KEY,ITEM> visitor, Sort sortBy, Criteria... expressions)
sortedQuery in interface SearchableCollection<KEY,ITEM>public List<Map<String,Object>> query(List<Selector> selectors, Criteria... expressions)
query in interface SearchableCollection<KEY,ITEM>public void invalidateIndex(String property, ITEM item)
invalidateIndex in interface SearchableCollection<KEY,ITEM>public void validateIndex(String property, ITEM item)
validateIndex in interface SearchableCollection<KEY,ITEM>public void clear()
clear in interface Collection<ITEM>public void setFilter(Filter filter)
setFilter in interface SearchableCollectionComposerpublic void addSearchIndex(String name, SearchIndex si)
addSearchIndex in interface SearchableCollection<KEY,ITEM>public void addLookupIndex(String name, LookupIndex si)
addLookupIndex in interface SearchableCollection<KEY,ITEM>public void setPrimaryKeyName(String primaryKey)
setPrimaryKeyName in interface SearchableCollectionComposerpublic Collection<ITEM> toCollection()
public boolean isEmpty()
isEmpty in interface Collection<ITEM>public Object[] toArray()
toArray in interface Collection<ITEM>public <T> T[] toArray(T[] a)
toArray in interface Collection<ITEM>public void setPrimaryKeyGetter(Function getter)
setPrimaryKeyGetter in interface SearchableCollectionComposerpublic void init()
init in interface SearchableCollectionComposerpublic void setFields(Map<String,FieldAccess> fields)
setFields in interface SearchableCollectionComposerpublic int size()
size in interface Collection<ITEM>public boolean addAll(Collection<? extends ITEM> items)
addAll in interface Collection<ITEM>public boolean remove(Object o)
remove in interface Collection<ITEM>public void removeByKey(KEY key)
removeByKey in interface SearchableCollection<KEY,ITEM>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<ITEM>public boolean removeAll(Collection<?> items)
removeAll in interface Collection<ITEM>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<ITEM>public boolean contains(Object o)
contains in interface Collection<ITEM>Copyright © 2016. All Rights Reserved.