Class ByteBufferLongBigList

  • 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>, FlyweightPrototype<ByteBufferLongBigList>, java.lang.Comparable<it.unimi.dsi.fastutil.BigList<? extends java.lang.Long>>, java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>

    @Deprecated
    public class ByteBufferLongBigList
    extends it.unimi.dsi.fastutil.longs.AbstractLongBigList
    implements FlyweightPrototype<ByteBufferLongBigList>
    Deprecated.
    Use LongMappedBigList instead.
    A bridge between byte buffers and long big lists.

    Java's memory-mapping facilities have the severe limitation of mapping at most Integer.MAX_VALUE bytes, as they expose the content of a file using a MappedByteBuffer. This class can expose a file of longs of arbitrary length as a LongBigList that is actually based on an array of MappedByteBuffers, each mapping a chunk of CHUNK_SIZE longs.

    Instances of this class are not thread safe, but the copy() method provides a lightweight duplicate that can be accessed independently by another thread. Only chunks that are actually used will be duplicated lazily.

    Author:
    Sebastiano Vigna
    • 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 
      Modifier Constructor Description
        ByteBufferLongBigList​(java.nio.ByteBuffer byteBuffer)
      Deprecated.
      Creates a new byte-buffer long big list from a single ByteBuffer.
      protected ByteBufferLongBigList​(java.nio.ByteBuffer[] byteBuffer, long size, boolean[] readyToUse)
      Deprecated.
      Creates a new byte-buffer long big list.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      ByteBufferLongBigList copy()
      Deprecated.
      Returns a copy of this object, sharing state with this object as much as possible.
      long getLong​(long index)
      Deprecated.
       
      static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel)
      Deprecated.
      Creates a new byte-buffer long big list by read-only mapping a given file channel using the standard Java (i.e., DataOutput) byte order (ByteOrder.BIG_ENDIAN).
      static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel, java.nio.ByteOrder byteOrder)
      Deprecated.
      Creates a new byte-buffer long big list by read-only mapping a given file channel.
      static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel, java.nio.ByteOrder byteOrder, java.nio.channels.FileChannel.MapMode mapMode)
      Deprecated.
      Creates a new byte-buffer long big list by mapping a given file channel.
      long set​(long index, long value)
      Deprecated.
       
      long size64()
      Deprecated.
       
      • 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, 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

      • ByteBufferLongBigList

        public ByteBufferLongBigList​(java.nio.ByteBuffer byteBuffer)
        Deprecated.
        Creates a new byte-buffer long big list from a single ByteBuffer.
        Parameters:
        byteBuffer - the underlying byte buffer.
      • ByteBufferLongBigList

        protected ByteBufferLongBigList​(java.nio.ByteBuffer[] byteBuffer,
                                        long size,
                                        boolean[] readyToUse)
        Deprecated.
        Creates a new byte-buffer long big list.
        Parameters:
        byteBuffer - the underlying byte buffers.
        size - the overall number of longs in the underlying byte buffers (i.e., the sum of the capacities of the byte buffers divided by eight).
        readyToUse - an array parallel to byteBuffer specifying which buffers do not need to be duplicated before being used (the process will happen lazily); the array will be used internally by the newly created byte-buffer long big list.
    • Method Detail

      • map

        public static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel)
                                         throws java.io.IOException
        Deprecated.
        Creates a new byte-buffer long big list by read-only mapping a given file channel using the standard Java (i.e., DataOutput) byte order (ByteOrder.BIG_ENDIAN).
        Parameters:
        fileChannel - the file channel that will be mapped.
        Returns:
        a new read-only byte-buffer long big list over the contents of fileChannel.
        Throws:
        java.io.IOException
        See Also:
        map(FileChannel, ByteOrder, MapMode)
      • map

        public static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel,
                                                java.nio.ByteOrder byteOrder)
                                         throws java.io.IOException
        Deprecated.
        Creates a new byte-buffer long big list by read-only mapping a given file channel.
        Parameters:
        fileChannel - the file channel that will be mapped.
        byteOrder - a prescribed byte order.
        Returns:
        a new read-only byte-buffer long big list over the contents of fileChannel.
        Throws:
        java.io.IOException
        See Also:
        map(FileChannel, ByteOrder, MapMode)
      • map

        public static ByteBufferLongBigList map​(java.nio.channels.FileChannel fileChannel,
                                                java.nio.ByteOrder byteOrder,
                                                java.nio.channels.FileChannel.MapMode mapMode)
                                         throws java.io.IOException
        Deprecated.
        Creates a new byte-buffer long big list by mapping a given file channel.
        Parameters:
        fileChannel - the file channel that will be mapped.
        byteOrder - a prescribed byte order.
        mapMode - the mapping mode: usually FileChannel.MapMode.READ_ONLY, but if intend to make the list mutable, you have to pass FileChannel.MapMode.READ_WRITE.
        Returns:
        a new byte-buffer long big list over the contents of fileChannel.
        Throws:
        java.io.IOException
      • getLong

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

        public long set​(long index,
                        long value)
        Deprecated.
        Specified by:
        set in interface it.unimi.dsi.fastutil.longs.LongBigList
        Overrides:
        set in class it.unimi.dsi.fastutil.longs.AbstractLongBigList
      • size64

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