Class MemoryCollection

java.lang.Object
de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
de.bwaldvogel.mongo.backend.AbstractSynchronizedMongoCollection<Integer>
de.bwaldvogel.mongo.backend.memory.MemoryCollection
All Implemented Interfaces:
de.bwaldvogel.mongo.MongoCollection<Integer>

public class MemoryCollection extends de.bwaldvogel.mongo.backend.AbstractSynchronizedMongoCollection<Integer>
  • Nested Class Summary

    Nested classes/interfaces inherited from class de.bwaldvogel.mongo.backend.AbstractMongoCollection

    de.bwaldvogel.mongo.backend.AbstractMongoCollection.FindAndModifyPlanExecutorError
  • Field Summary

    Fields inherited from class de.bwaldvogel.mongo.backend.AbstractMongoCollection

    cursorRegistry, options
  • Constructor Summary

    Constructors
    Constructor
    Description
    MemoryCollection(de.bwaldvogel.mongo.MongoDatabase database, String collectionName, de.bwaldvogel.mongo.backend.CollectionOptions options, de.bwaldvogel.mongo.backend.CursorRegistry cursorRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Integer
    addDocumentInternal(de.bwaldvogel.mongo.bson.Document document)
     
    int
     
    protected Integer
    findDocumentPosition(de.bwaldvogel.mongo.bson.Document document)
     
    protected int
     
    protected de.bwaldvogel.mongo.bson.Document
    getDocument(Integer position)
     
    protected void
    handleUpdate(Integer position, de.bwaldvogel.mongo.bson.Document oldDocument, de.bwaldvogel.mongo.bson.Document newDocument)
     
    boolean
     
    protected de.bwaldvogel.mongo.backend.QueryResult
    matchDocuments(de.bwaldvogel.mongo.bson.Document query, de.bwaldvogel.mongo.bson.Document orderBy, int numberToSkip, int limit, int batchSize, de.bwaldvogel.mongo.bson.Document fieldSelector)
     
    protected void
     
    protected Stream<de.bwaldvogel.mongo.backend.DocumentWithPosition<Integer>>
     
    protected void
    updateDataSize(int sizeDelta)
     

    Methods inherited from class de.bwaldvogel.mongo.backend.AbstractSynchronizedMongoCollection

    addDocument, addDocuments, deleteDocuments, findAndModify, handleDistinct, handleQuery, insertDocuments, removeDocument, renameTo, updateDocuments

    Methods inherited from class de.bwaldvogel.mongo.backend.AbstractMongoCollection

    addIndex, count, createCursor, createQueryResult, deriveComparator, documentMatchesQuery, drop, dropIndex, getCollectionName, getDatabase, getIdField, getIndexes, getStats, getUuid, isNaturalDescending, matchDocuments, matchDocumentsFromStream, matchDocumentsFromStream, queryDocuments, toString, tracksDataSize, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface de.bwaldvogel.mongo.MongoCollection

    addDocumentIfMissing, deleteDocuments, getDatabaseName, getFullName, getNumIndexes, handleQuery, handleQuery, handleQueryAsStream, insertDocuments, queryAll, queryAllAsStream
  • Constructor Details

    • MemoryCollection

      public MemoryCollection(de.bwaldvogel.mongo.MongoDatabase database, String collectionName, de.bwaldvogel.mongo.backend.CollectionOptions options, de.bwaldvogel.mongo.backend.CursorRegistry cursorRegistry)
  • Method Details

    • updateDataSize

      protected void updateDataSize(int sizeDelta)
      Specified by:
      updateDataSize in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • getDataSize

      protected int getDataSize()
      Specified by:
      getDataSize in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • addDocumentInternal

      protected Integer addDocumentInternal(de.bwaldvogel.mongo.bson.Document document)
      Specified by:
      addDocumentInternal in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • matchDocuments

      protected de.bwaldvogel.mongo.backend.QueryResult matchDocuments(de.bwaldvogel.mongo.bson.Document query, de.bwaldvogel.mongo.bson.Document orderBy, int numberToSkip, int limit, int batchSize, de.bwaldvogel.mongo.bson.Document fieldSelector)
      Specified by:
      matchDocuments in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • count

      public int count()
    • isEmpty

      public boolean isEmpty()
    • findDocumentPosition

      protected Integer findDocumentPosition(de.bwaldvogel.mongo.bson.Document document)
      Overrides:
      findDocumentPosition in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • streamAllDocumentsWithPosition

      protected Stream<de.bwaldvogel.mongo.backend.DocumentWithPosition<Integer>> streamAllDocumentsWithPosition()
      Specified by:
      streamAllDocumentsWithPosition in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • removeDocument

      protected void removeDocument(Integer position)
      Specified by:
      removeDocument in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • getDocument

      protected de.bwaldvogel.mongo.bson.Document getDocument(Integer position)
      Specified by:
      getDocument in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>
    • handleUpdate

      protected void handleUpdate(Integer position, de.bwaldvogel.mongo.bson.Document oldDocument, de.bwaldvogel.mongo.bson.Document newDocument)
      Specified by:
      handleUpdate in class de.bwaldvogel.mongo.backend.AbstractMongoCollection<Integer>