Class ArrayBackedCollection<T>

java.lang.Object
com.espertech.esper.common.internal.collection.ArrayBackedCollection<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>

public class ArrayBackedCollection<T> extends Object implements Collection<T>
A fast collection backed by an array with severe limitations. Allows direct access to the backing array - this must be used with care as old elements could be in the array and the array is only valid until the number of elements indicated by size.

Implements only the add, size and clear methods of the collection interface.

When running out of space for the underlying array, allocates a new array of double the size of the current array.

Not synchronized and not thread-safe.

  • Constructor Details

    • ArrayBackedCollection

      public ArrayBackedCollection(int currentSize)
      Ctor.
      Parameters:
      currentSize - is the initial size of the backing array.
  • Method Details