Interface CombinedMemoryModel.CombinerInPlace<E>

All Superinterfaces:
CombinedMemoryModel.Combiner<E>
All Known Implementing Classes:
CombinedMemoryModel.AbstractByteBufferCombinerInPlace
Enclosing class:
CombinedMemoryModel<E>

public static interface CombinedMemoryModel.CombinerInPlace<E> extends CombinedMemoryModel.Combiner<E>

Special version of CombinedMemoryModel.Combiner interface allowing to load an element without creating new Java object. If the argument of CombinedMemoryModel.getInstance(Combiner) method implements this interface, then the arrays created by returned memory model will implement MutableObjectInPlaceArray (or, maybe, only UpdatableObjectInPlaceArray or ObjectInPlaceArray, for arrays created by CombinedMemoryModel.asUpdatableCombinedArray(Class, UpdatableArray[]) or CombinedMemoryModel.asCombinedArray(Class, Array[]) methods).

  • Method Details

    • allocateElement

      E allocateElement()
      Creates a new element that can be stored in or loaded from the combined array. Never returns null.
      Returns:
      some instance of an element of the combined array.
    • getInPlace

      void getInPlace(long index, E resultValue, Array[] storage)
      Loads an element #index of the combined array from the given set of arrays into resultValue object. This method is called by ObjectInPlaceArray.getInPlace(long, Object) method.
      Parameters:
      index - an index in the combined array.
      resultValue - the object where the retrieved content will be stored.
      storage - a set of arrays where the retrieved content is stored now.
      Throws:
      NullPointerException - if resultValue is null.