Class PrimitiveLongList


  • public final class PrimitiveLongList
    extends java.lang.Object
    A list of longs backed by, and exposing, an array of primitives. Values will be boxed on demand when using standard List operations. Operations should generally use the static methods in this class to operate directly on the backing array instead. The idea is that in almost all apps, the list will only be accessed by our internal code, and if it does happen to be used elsewhere, performance of on-demand boxing isn't prohibitive while still providing expected ergonomics.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PrimitiveLongList()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long[] toArray​(java.util.List<java.lang.Long> list)
      Returns a primitive array with the values of the list.
      static java.util.List<java.lang.Long> wrap​(long[] values)
      Returns a list that wraps the primitive array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimitiveLongList

        private PrimitiveLongList()
    • Method Detail

      • wrap

        public static java.util.List<java.lang.Long> wrap​(long[] values)
        Returns a list that wraps the primitive array. Modifications in the array will be visible in the list.
      • toArray

        public static long[] toArray​(java.util.List<java.lang.Long> list)
        Returns a primitive array with the values of the list. The list should generally have been created with wrap(long[]).