Class TwoSizesLongBigList

  • All Implemented Interfaces:
    it.unimi.dsi.fastutil.BigList<java.lang.Long>, it.unimi.dsi.fastutil.longs.LongBigList, it.unimi.dsi.fastutil.longs.LongCollection, it.unimi.dsi.fastutil.longs.LongIterable, it.unimi.dsi.fastutil.longs.LongStack, it.unimi.dsi.fastutil.Size64, it.unimi.dsi.fastutil.Stack<java.lang.Long>, java.io.Serializable, java.lang.Comparable<it.unimi.dsi.fastutil.BigList<? extends java.lang.Long>>, java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>

    public class TwoSizesLongBigList
    extends it.unimi.dsi.fastutil.longs.AbstractLongBigList
    implements java.io.Serializable
    A compressed big list of longs; small elements and large elements are stored separately, using two different, optimally chosen bit sizes.

    Instances of this class store in a compacted form a list of natural numbers. Values are provided either through an iterable object. You will obtain a reduction in size only if the distribution of the values of the list is skewed towards small values.

    Implementation details

    Instances of this class store elements in two different LongArrayBitVector-based lists—one for large values and one for small values. The threshold between large and small is established by measuring at construction time the most proficuous choice. A ranking structure built on a marker array (recording which elements are stored in the large list) provides access of the correct element in each array.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList

        it.unimi.dsi.fastutil.longs.AbstractLongBigList.LongRandomAccessSubList, it.unimi.dsi.fastutil.longs.AbstractLongBigList.LongSubList
    • Constructor Summary

      Constructors 
      Constructor Description
      TwoSizesLongBigList​(it.unimi.dsi.fastutil.bytes.ByteIterable elements)
      Builds a new two-sizes long big list using a given iterable object.
      TwoSizesLongBigList​(it.unimi.dsi.fastutil.ints.IntIterable elements)
      Builds a new two-sizes long big list using a given iterable object.
      TwoSizesLongBigList​(it.unimi.dsi.fastutil.longs.LongIterable elements)
      Builds a new two-sizes long big list using a given iterable object.
      TwoSizesLongBigList​(it.unimi.dsi.fastutil.shorts.ShortIterable elements)
      Builds a new two-sizes long big list using a given iterable object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getLong​(long index)  
      long numBits()  
      long size64()  
      • Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongBigList

        add, add, add, addAll, addAll, addAll, addAll, addElements, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, forEach, get, getElements, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekLong, pop, popLong, push, push, rem, remove, removeElements, removeLong, set, set, setElements, size, size, subList, top, topLong, toString
      • Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection

        add, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toLongArray, toLongArray
      • Methods inherited from class java.util.AbstractCollection

        isEmpty, toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toArray
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongBigList

        addAll, addAll, addAll, addAll, getElements, setElements, setElements, spliterator
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection

        add, contains, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toLongArray, toLongArray
      • Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable

        forEach, forEach
      • Methods inherited from interface it.unimi.dsi.fastutil.Stack

        isEmpty
    • Constructor Detail

      • TwoSizesLongBigList

        public TwoSizesLongBigList​(it.unimi.dsi.fastutil.ints.IntIterable elements)
        Builds a new two-sizes long big list using a given iterable object.
        Parameters:
        elements - an iterable object.
      • TwoSizesLongBigList

        public TwoSizesLongBigList​(it.unimi.dsi.fastutil.shorts.ShortIterable elements)
        Builds a new two-sizes long big list using a given iterable object.
        Parameters:
        elements - an iterable object.
      • TwoSizesLongBigList

        public TwoSizesLongBigList​(it.unimi.dsi.fastutil.bytes.ByteIterable elements)
        Builds a new two-sizes long big list using a given iterable object.
        Parameters:
        elements - an iterable object.
      • TwoSizesLongBigList

        public TwoSizesLongBigList​(it.unimi.dsi.fastutil.longs.LongIterable elements)
        Builds a new two-sizes long big list using a given iterable object.
        Parameters:
        elements - an iterable object.
    • Method Detail

      • getLong

        public long getLong​(long index)
        Specified by:
        getLong in interface it.unimi.dsi.fastutil.longs.LongBigList
      • size64

        public long size64()
        Specified by:
        size64 in interface it.unimi.dsi.fastutil.Size64
      • numBits

        public long numBits()