Package de.bwaldvogel.mongo.backend
Class Index<P>
- java.lang.Object
-
- de.bwaldvogel.mongo.backend.Index<P>
-
- Direct Known Subclasses:
AbstractUniqueIndex
public abstract class Index<P> extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidadd(Document document, P position, MongoCollection<P> collection)abstract booleancanHandle(Document query)abstract voidcheckAdd(Document document, MongoCollection<P> collection)abstract voidcheckUpdate(Document oldDocument, Document newDocument, MongoCollection<P> collection)abstract voiddrop()abstract longgetCount()abstract longgetDataSize()protected java.util.List<IndexKey>getKeys()java.util.Set<KeyValue>getKeyValues(Document document)java.lang.StringgetName()abstract PgetPosition(Document document)abstract java.lang.Iterable<P>getPositions(Document query)booleanhasSameOptions(Index<?> other)protected booleanisCompoundIndex()booleanisEmpty()protected booleanisSparse()protected java.util.List<java.lang.String>keys()protected java.util.Set<java.lang.String>keySet()protected booleannullAwareEqualsKeys(Document oldDocument, Document newDocument)abstract Premove(Document document)java.lang.StringtoString()abstract voidupdateInPlace(Document oldDocument, Document newDocument, P position, MongoCollection<P> collection)
-
-
-
Constructor Detail
-
Index
protected Index(java.lang.String name, java.util.List<IndexKey> keys, boolean sparse)
-
-
Method Detail
-
isSparse
protected boolean isSparse()
-
getKeys
protected java.util.List<IndexKey> getKeys()
-
hasSameOptions
public boolean hasSameOptions(Index<?> other)
-
getName
public java.lang.String getName()
-
keys
protected java.util.List<java.lang.String> keys()
-
keySet
protected java.util.Set<java.lang.String> keySet()
-
checkAdd
public abstract void checkAdd(Document document, MongoCollection<P> collection)
-
add
public abstract void add(Document document, P position, MongoCollection<P> collection)
-
canHandle
public abstract boolean canHandle(Document query)
-
getCount
public abstract long getCount()
-
isEmpty
public boolean isEmpty()
-
getDataSize
public abstract long getDataSize()
-
checkUpdate
public abstract void checkUpdate(Document oldDocument, Document newDocument, MongoCollection<P> collection)
-
updateInPlace
public abstract void updateInPlace(Document oldDocument, Document newDocument, P position, MongoCollection<P> collection) throws KeyConstraintError
- Throws:
KeyConstraintError
-
isCompoundIndex
protected boolean isCompoundIndex()
-
nullAwareEqualsKeys
protected boolean nullAwareEqualsKeys(Document oldDocument, Document newDocument)
-
drop
public abstract void drop()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-