Package de.bwaldvogel.mongo.backend
Class AbstractUniqueIndex<P>
java.lang.Object
de.bwaldvogel.mongo.backend.Index<P>
de.bwaldvogel.mongo.backend.AbstractUniqueIndex<P>
public abstract class AbstractUniqueIndex<P> extends Index<P>
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractUniqueIndex(java.lang.String name, java.util.List<IndexKey> keys, boolean sparse) -
Method Summary
Modifier and Type Method Description voidadd(Document document, P position, MongoCollection<P> collection)booleancanHandle(Document query)voidcheckAdd(Document document, MongoCollection<P> collection)voidcheckUpdate(Document oldDocument, Document newDocument, MongoCollection<P> collection)protected booleancontainsKey(KeyValue keyValue)voiddrop()protected abstract java.lang.Iterable<java.util.Map.Entry<KeyValue,P>>getIterable()protected abstract PgetPosition(KeyValue keyValue)PgetPosition(Document document)java.lang.Iterable<P>getPositions(Document query)protected abstract booleanputKeyPosition(KeyValue keyValue, P position)Premove(Document document)protected abstract PremoveDocument(KeyValue keyValue)voidupdateInPlace(Document oldDocument, Document newDocument, P position, MongoCollection<P> collection)Methods inherited from class de.bwaldvogel.mongo.backend.Index
getCount, getDataSize, getKeys, getKeyValues, getName, hasSameOptions, isCompoundIndex, isEmpty, isSparse, keys, keySet, nullAwareEqualsKeys, toString
-
Constructor Details
-
AbstractUniqueIndex
protected AbstractUniqueIndex(java.lang.String name, java.util.List<IndexKey> keys, boolean sparse)
-
-
Method Details
-
removeDocument
-
containsKey
-
putKeyPosition
-
getIterable
-
getPosition
-
remove
-
getPosition
- Specified by:
getPositionin classIndex<P>
-
checkAdd
-
add
-
checkUpdate
- Specified by:
checkUpdatein classIndex<P>
-
updateInPlace
public void updateInPlace(Document oldDocument, Document newDocument, P position, MongoCollection<P> collection) throws KeyConstraintError- Specified by:
updateInPlacein classIndex<P>- Throws:
KeyConstraintError
-
canHandle
-
getPositions
- Specified by:
getPositionsin classIndex<P>
-
drop
public void drop()
-