KEY
- key to lookupITEM
- valuepublic class LookupIndexDefault<KEY,ITEM> extends java.lang.Object implements LookupIndex<KEY,ITEM>
Modifier and Type | Field and Description |
---|---|
protected int |
keyBucketSize |
protected Function<ITEM,KEY> |
keyGetter |
protected java.util.Map<KEY,org.boon.datarepo.impl.indexes.MultiValue> |
map |
protected Function<ITEM,KEY> |
primaryKeyGetter |
protected boolean |
storeKeyInIndexOnly |
Constructor and Description |
---|
LookupIndexDefault(java.lang.Class<?> keyType) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(ITEM item) |
protected void |
addManyKeys(ITEM item,
java.util.List<KEY> keys) |
java.util.List<ITEM> |
all() |
void |
clear() |
boolean |
delete(ITEM item) |
boolean |
deleteByKey(KEY key) |
ITEM |
get(KEY key) |
java.util.List<ITEM> |
getAll(KEY key) |
protected KEY |
getKey(KEY key) |
void |
init() |
boolean |
isPrimaryKeyOnly() |
protected void |
removeManyKeys(ITEM item,
java.util.List<KEY> keys) |
void |
setBucketSize(int size) |
void |
setInputKeyTransformer(Function<java.lang.Object,KEY> func) |
void |
setKeyGetter(Function<ITEM,KEY> keyGetter) |
void |
setPrimaryKeyGetter(Function<ITEM,KEY> keyGetter) |
int |
size() |
java.util.Collection<ITEM> |
toCollection() |
protected java.util.Map<KEY,org.boon.datarepo.impl.indexes.MultiValue> map
protected boolean storeKeyInIndexOnly
protected int keyBucketSize
public void setKeyGetter(Function<ITEM,KEY> keyGetter)
setKeyGetter
in interface LookupIndex<KEY,ITEM>
public java.util.Collection<ITEM> toCollection()
toCollection
in interface Bag<ITEM>
public java.util.List<ITEM> getAll(KEY key)
getAll
in interface LookupIndex<KEY,ITEM>
public boolean deleteByKey(KEY key)
deleteByKey
in interface LookupIndex<KEY,ITEM>
public boolean isPrimaryKeyOnly()
isPrimaryKeyOnly
in interface LookupIndex<KEY,ITEM>
public void setInputKeyTransformer(Function<java.lang.Object,KEY> func)
setInputKeyTransformer
in interface LookupIndex<KEY,ITEM>
public void setBucketSize(int size)
setBucketSize
in interface LookupIndex<KEY,ITEM>
public void init()
init
in interface LookupIndex<KEY,ITEM>