Interface Size64

All Known Subinterfaces:
BigList<K>, BooleanBigList, ByteBigList, CharBigList, DoubleBigList, FloatBigList, IntBigList, LongBigList, ObjectBigList<K>, ReferenceBigList<K>, ShortBigList
All Known Implementing Classes:
AbstractBooleanBigList, AbstractBooleanBigList.BooleanRandomAccessSubList, AbstractBooleanBigList.BooleanSubList, AbstractByteBigList, AbstractByteBigList.ByteRandomAccessSubList, AbstractByteBigList.ByteSubList, AbstractCharBigList, AbstractCharBigList.CharRandomAccessSubList, AbstractCharBigList.CharSubList, AbstractDoubleBigList, AbstractDoubleBigList.DoubleRandomAccessSubList, AbstractDoubleBigList.DoubleSubList, AbstractFloatBigList, AbstractFloatBigList.FloatRandomAccessSubList, AbstractFloatBigList.FloatSubList, AbstractIntBigList, AbstractIntBigList.IntRandomAccessSubList, AbstractIntBigList.IntSubList, AbstractLongBigList, AbstractLongBigList.LongRandomAccessSubList, AbstractLongBigList.LongSubList, AbstractObjectBigList, AbstractObjectBigList.ObjectRandomAccessSubList, AbstractObjectBigList.ObjectSubList, AbstractReferenceBigList, AbstractReferenceBigList.ReferenceRandomAccessSubList, AbstractReferenceBigList.ReferenceSubList, AbstractShortBigList, AbstractShortBigList.ShortRandomAccessSubList, AbstractShortBigList.ShortSubList, BooleanBigArrayBigList, BooleanBigLists.EmptyBigList, BooleanBigLists.ListBigList, BooleanBigLists.Singleton, BooleanBigLists.SynchronizedBigList, BooleanBigLists.UnmodifiableBigList, ByteArrayFrontCodedBigList, ByteBigArrayBigList, ByteBigLists.EmptyBigList, ByteBigLists.ListBigList, ByteBigLists.Singleton, ByteBigLists.SynchronizedBigList, ByteBigLists.UnmodifiableBigList, ByteMappedBigList, CharArrayFrontCodedBigList, CharBigArrayBigList, CharBigLists.EmptyBigList, CharBigLists.ListBigList, CharBigLists.Singleton, CharBigLists.SynchronizedBigList, CharBigLists.UnmodifiableBigList, CharMappedBigList, DoubleBigArrayBigList, DoubleBigLists.EmptyBigList, DoubleBigLists.ListBigList, DoubleBigLists.Singleton, DoubleBigLists.SynchronizedBigList, DoubleBigLists.UnmodifiableBigList, DoubleMappedBigList, DoubleOpenHashBigSet, FloatBigArrayBigList, FloatBigLists.EmptyBigList, FloatBigLists.ListBigList, FloatBigLists.Singleton, FloatBigLists.SynchronizedBigList, FloatBigLists.UnmodifiableBigList, FloatMappedBigList, FloatOpenHashBigSet, IntArrayFrontCodedBigList, IntBigArrayBigList, IntBigLists.EmptyBigList, IntBigLists.ListBigList, IntBigLists.Singleton, IntBigLists.SynchronizedBigList, IntBigLists.UnmodifiableBigList, IntMappedBigList, IntOpenHashBigSet, LongArrayFrontCodedBigList, LongBigArrayBigList, LongBigLists.EmptyBigList, LongBigLists.ListBigList, LongBigLists.Singleton, LongBigLists.SynchronizedBigList, LongBigLists.UnmodifiableBigList, LongMappedBigList, LongOpenHashBigSet, ObjectBigArrayBigList, ObjectBigLists.EmptyBigList, ObjectBigLists.ListBigList, ObjectBigLists.Singleton, ObjectBigLists.SynchronizedBigList, ObjectBigLists.UnmodifiableBigList, ObjectOpenHashBigSet, ReferenceBigArrayBigList, ReferenceBigLists.EmptyBigList, ReferenceBigLists.ListBigList, ReferenceBigLists.Singleton, ReferenceBigLists.SynchronizedBigList, ReferenceBigLists.UnmodifiableBigList, ReferenceOpenHashBigSet, ShortArrayFrontCodedBigList, ShortBigArrayBigList, ShortBigLists.EmptyBigList, ShortBigLists.ListBigList, ShortBigLists.Singleton, ShortBigLists.SynchronizedBigList, ShortBigLists.UnmodifiableBigList, ShortMappedBigList

public interface Size64
An interface for data structures whose size can exceed Integer.MAX_VALUE.

The only methods specified by this interfaces are size64(), and a deprecated size() identical to Collection.size(), but with a default implementation. Implementations can work around the type problem of Collection.size() (e.g., not being able to return more than Integer.MAX_VALUE) by implementing this interface. Callers interested in large structures can use a reflective call to instanceof to check for the presence of size64().

  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Deprecated.
    Use size64() instead.
    long
    Returns the size of this data structure as a long.
    static long
    Returns the size for a given Collection as a long, using size64() if applicable, else using Collection.size().
    static long
    sizeOf(Map<?,?> m)
    Returns the size for a given Map as a long, using size64() if applicable, else using Map.size().
  • Method Details

    • size64

      long size64()
      Returns the size of this data structure as a long.
      Returns:
      the size of this data structure.
    • size

      @Deprecated default int size()
      Deprecated.
      Use size64() instead.
      Returns the size of this data structure, minimized with Integer.MAX_VALUE.

      This default implementation follows the definition above, which is compatible with Collection.size().

      Returns:
      the size of this data structure, minimized with Integer.MAX_VALUE.
      See Also:
    • sizeOf

      static long sizeOf(Collection<?> c)
      Returns the size for a given Collection as a long, using size64() if applicable, else using Collection.size().
      Parameters:
      c - the collection whose size to get
      Returns:
      the size
    • sizeOf

      static long sizeOf(Map<?,?> m)
      Returns the size for a given Map as a long, using size64() if applicable, else using Map.size().
      Parameters:
      m - the map whose size to get
      Returns:
      the size