Class Capacity

java.lang.Object
io.immutables.common.Capacity

public final class Capacity extends Object
Ensures capacity for arrays by nearest larger power of 2 increase in size and trying to avoid overflows until max size for array is reached.
  • Method Summary

    Modifier and Type
    Method
    Description
    static char[]
    ensure(char[] elements, int limit, int increment)
     
    static int[]
    ensure(int[] elements, int limit, int increment)
     
    static long[]
    ensure(long[] elements, int limit, int increment)
     
    static <T> T[]
    ensure(T[] elements, int limit, int increment)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • ensure

      public static int[] ensure(int[] elements, int limit, int increment)
    • ensure

      public static char[] ensure(char[] elements, int limit, int increment)
    • ensure

      public static long[] ensure(long[] elements, int limit, int increment)
    • ensure

      public static <T> T[] ensure(T[] elements, int limit, int increment)