Class DynamicIntArray

java.lang.Object
org.apache.orc.impl.DynamicIntArray

public final class DynamicIntArray extends Object
Dynamic int array that uses primitive types and chunks to avoid copying large number of integers when it resizes.

The motivation for this class is memory optimization, i.e. space efficient storage of potentially huge arrays without good a-priori size guesses.

The API of this class is between a primitive array and a AbstractList. It's not a Collection implementation because it handles primitive types, but the API could be extended to support iterators and the like.

NOTE: Like standard Collection implementations/arrays, this class is not synchronized.

  • Constructor Details

    • DynamicIntArray

      public DynamicIntArray()
    • DynamicIntArray

      public DynamicIntArray(int chunkSize)
  • Method Details

    • get

      public int get(int index)
    • set

      public void set(int index, int value)
    • increment

      public void increment(int index, int value)
    • add

      public void add(int value)
    • size

      public int size()
    • clear

      public void clear()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSizeInBytes

      public int getSizeInBytes()