Interface UpdatableIndex<V>

All Superinterfaces:
Index<V>, Iterable<Map.Entry<IndexKey,V>>, ModifiableIndex<V>

public interface UpdatableIndex<V> extends ModifiableIndex<V>
Represents an index that can be modifies using put and remove functions and that can be serialized as an attribute in an Obj interface via IndexContainer.
  • Method Details

    • toIndexed

      IndexContainer<V> toIndexed(@Nonnull String prefix, @Nonnull BiConsumer<String,? super Obj> persistObj)
      Build a serializable index container from this index object. This updatable index may no longer be accessible after this function has been called, runtime exception may be thrown if the index is accessed after calling this function.
      Parameters:
      prefix - prefix to pass to the string argument of the persistObj consumer.
      persistObj - callback invoked to persist the object, to be delegated to CommitterState.writeOrReplace()
      Returns:
      the updated IndexContainer
    • toOptionalIndexed

      Optional<IndexContainer<V>> toOptionalIndexed(@Nonnull String prefix, @Nonnull BiConsumer<String,? super Obj> persistObj)
      Similar to toIndexed(String, BiConsumer), but returns an empty Optional, if the index container is empty.