Class TByteLinkedList

  • All Implemented Interfaces:
    gnu.trove.list.TByteList, gnu.trove.TByteCollection, java.io.Externalizable, java.io.Serializable

    public class TByteLinkedList
    extends java.lang.Object
    implements gnu.trove.list.TByteList, java.io.Externalizable
    A resizable, double linked list of byte primitives.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface gnu.trove.TByteCollection

        serialVersionUID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(byte val)
      void add​(byte[] vals)
      void add​(byte[] vals, int offset, int length)
      boolean addAll​(byte[] array)
      boolean addAll​(gnu.trove.TByteCollection collection)
      boolean addAll​(java.util.Collection<? extends java.lang.Byte> collection)
      int binarySearch​(byte value)
      int binarySearch​(byte value, int fromIndex, int toIndex)
      void clear()
      boolean contains​(byte value)
      boolean containsAll​(byte[] array)
      boolean containsAll​(gnu.trove.TByteCollection collection)
      boolean containsAll​(java.util.Collection<?> collection)
      boolean equals​(java.lang.Object other)
      void fill​(byte val)
      void fill​(int fromIndex, int toIndex, byte val)
      boolean forEach​(gnu.trove.procedure.TByteProcedure procedure)
      boolean forEachDescending​(gnu.trove.procedure.TByteProcedure procedure)
      byte get​(int offset)
      gnu.trove.list.linked.TByteLinkedList.TByteLink getLinkAt​(int offset)
      Returns the link at the given offset.
      byte getNoEntryValue()
      gnu.trove.list.TByteList grep​(gnu.trove.procedure.TByteProcedure condition)
      int hashCode()
      int indexOf​(byte value)
      int indexOf​(int offset, byte value)
      void insert​(int offset, byte value)
      void insert​(int offset, byte[] values)
      void insert​(int offset, byte[] values, int valOffset, int len)
      gnu.trove.list.TByteList inverseGrep​(gnu.trove.procedure.TByteProcedure condition)
      boolean isEmpty()
      gnu.trove.iterator.TByteIterator iterator()
      int lastIndexOf​(byte value)
      int lastIndexOf​(int offset, byte value)
      byte max()
      byte min()
      void readExternal​(java.io.ObjectInput in)
      boolean remove​(byte value)
      void remove​(int offset, int length)
      boolean removeAll​(byte[] array)
      boolean removeAll​(gnu.trove.TByteCollection collection)
      boolean removeAll​(java.util.Collection<?> collection)
      byte removeAt​(int offset)
      byte replace​(int offset, byte val)
      boolean retainAll​(byte[] array)
      boolean retainAll​(gnu.trove.TByteCollection collection)
      boolean retainAll​(java.util.Collection<?> collection)
      void reverse()
      void reverse​(int from, int to)
      byte set​(int offset, byte val)
      void set​(int offset, byte[] values)
      void set​(int offset, byte[] values, int valOffset, int length)
      void shuffle​(java.util.Random rand)
      int size()
      void sort()
      void sort​(int fromIndex, int toIndex)
      gnu.trove.list.TByteList subList​(int begin, int end)
      byte sum()
      byte[] toArray()
      byte[] toArray​(byte[] dest)
      byte[] toArray​(byte[] dest, int offset, int len)
      byte[] toArray​(byte[] dest, int source_pos, int dest_pos, int len)
      byte[] toArray​(int offset, int len)
      java.lang.String toString()  
      void transformValues​(gnu.trove.function.TByteFunction function)
      void writeExternal​(java.io.ObjectOutput out)
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TByteLinkedList

        public TByteLinkedList()
      • TByteLinkedList

        public TByteLinkedList​(byte no_entry_value)
      • TByteLinkedList

        public TByteLinkedList​(gnu.trove.list.TByteList list)
    • Method Detail

      • getNoEntryValue

        public byte getNoEntryValue()
        Specified by:
        getNoEntryValue in interface gnu.trove.TByteCollection
        Specified by:
        getNoEntryValue in interface gnu.trove.list.TByteList
      • size

        public int size()
        Specified by:
        size in interface gnu.trove.TByteCollection
        Specified by:
        size in interface gnu.trove.list.TByteList
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface gnu.trove.TByteCollection
        Specified by:
        isEmpty in interface gnu.trove.list.TByteList
      • add

        public boolean add​(byte val)
        Specified by:
        add in interface gnu.trove.TByteCollection
        Specified by:
        add in interface gnu.trove.list.TByteList
      • add

        public void add​(byte[] vals)
        Specified by:
        add in interface gnu.trove.list.TByteList
      • add

        public void add​(byte[] vals,
                        int offset,
                        int length)
        Specified by:
        add in interface gnu.trove.list.TByteList
      • insert

        public void insert​(int offset,
                           byte value)
        Specified by:
        insert in interface gnu.trove.list.TByteList
      • insert

        public void insert​(int offset,
                           byte[] values)
        Specified by:
        insert in interface gnu.trove.list.TByteList
      • insert

        public void insert​(int offset,
                           byte[] values,
                           int valOffset,
                           int len)
        Specified by:
        insert in interface gnu.trove.list.TByteList
      • get

        public byte get​(int offset)
        Specified by:
        get in interface gnu.trove.list.TByteList
      • getLinkAt

        public gnu.trove.list.linked.TByteLinkedList.TByteLink getLinkAt​(int offset)

        Returns the link at the given offset.

        A simple bisection criteria is used to keep the worst case complexity equal to O(n/2) where n = size(). Simply start from head of list or tail depending on offset and list size.

        Parameters:
        offset - of the link
        Returns:
        link or null if non-existent
      • set

        public byte set​(int offset,
                        byte val)
        Specified by:
        set in interface gnu.trove.list.TByteList
      • set

        public void set​(int offset,
                        byte[] values)
        Specified by:
        set in interface gnu.trove.list.TByteList
      • set

        public void set​(int offset,
                        byte[] values,
                        int valOffset,
                        int length)
        Specified by:
        set in interface gnu.trove.list.TByteList
      • replace

        public byte replace​(int offset,
                            byte val)
        Specified by:
        replace in interface gnu.trove.list.TByteList
      • clear

        public void clear()
        Specified by:
        clear in interface gnu.trove.TByteCollection
        Specified by:
        clear in interface gnu.trove.list.TByteList
      • remove

        public boolean remove​(byte value)
        Specified by:
        remove in interface gnu.trove.TByteCollection
        Specified by:
        remove in interface gnu.trove.list.TByteList
      • containsAll

        public boolean containsAll​(java.util.Collection<?> collection)
        Specified by:
        containsAll in interface gnu.trove.TByteCollection
      • containsAll

        public boolean containsAll​(gnu.trove.TByteCollection collection)
        Specified by:
        containsAll in interface gnu.trove.TByteCollection
      • containsAll

        public boolean containsAll​(byte[] array)
        Specified by:
        containsAll in interface gnu.trove.TByteCollection
      • addAll

        public boolean addAll​(java.util.Collection<? extends java.lang.Byte> collection)
        Specified by:
        addAll in interface gnu.trove.TByteCollection
      • addAll

        public boolean addAll​(gnu.trove.TByteCollection collection)
        Specified by:
        addAll in interface gnu.trove.TByteCollection
      • addAll

        public boolean addAll​(byte[] array)
        Specified by:
        addAll in interface gnu.trove.TByteCollection
      • retainAll

        public boolean retainAll​(java.util.Collection<?> collection)
        Specified by:
        retainAll in interface gnu.trove.TByteCollection
      • retainAll

        public boolean retainAll​(gnu.trove.TByteCollection collection)
        Specified by:
        retainAll in interface gnu.trove.TByteCollection
      • retainAll

        public boolean retainAll​(byte[] array)
        Specified by:
        retainAll in interface gnu.trove.TByteCollection
      • removeAll

        public boolean removeAll​(java.util.Collection<?> collection)
        Specified by:
        removeAll in interface gnu.trove.TByteCollection
      • removeAll

        public boolean removeAll​(gnu.trove.TByteCollection collection)
        Specified by:
        removeAll in interface gnu.trove.TByteCollection
      • removeAll

        public boolean removeAll​(byte[] array)
        Specified by:
        removeAll in interface gnu.trove.TByteCollection
      • removeAt

        public byte removeAt​(int offset)
        Specified by:
        removeAt in interface gnu.trove.list.TByteList
      • remove

        public void remove​(int offset,
                           int length)
        Specified by:
        remove in interface gnu.trove.list.TByteList
      • transformValues

        public void transformValues​(gnu.trove.function.TByteFunction function)
        Specified by:
        transformValues in interface gnu.trove.list.TByteList
      • reverse

        public void reverse()
        Specified by:
        reverse in interface gnu.trove.list.TByteList
      • reverse

        public void reverse​(int from,
                            int to)
        Specified by:
        reverse in interface gnu.trove.list.TByteList
      • shuffle

        public void shuffle​(java.util.Random rand)
        Specified by:
        shuffle in interface gnu.trove.list.TByteList
      • subList

        public gnu.trove.list.TByteList subList​(int begin,
                                                int end)
        Specified by:
        subList in interface gnu.trove.list.TByteList
      • toArray

        public byte[] toArray()
        Specified by:
        toArray in interface gnu.trove.TByteCollection
        Specified by:
        toArray in interface gnu.trove.list.TByteList
      • toArray

        public byte[] toArray​(int offset,
                              int len)
        Specified by:
        toArray in interface gnu.trove.list.TByteList
      • toArray

        public byte[] toArray​(byte[] dest)
        Specified by:
        toArray in interface gnu.trove.TByteCollection
        Specified by:
        toArray in interface gnu.trove.list.TByteList
      • toArray

        public byte[] toArray​(byte[] dest,
                              int offset,
                              int len)
        Specified by:
        toArray in interface gnu.trove.list.TByteList
      • toArray

        public byte[] toArray​(byte[] dest,
                              int source_pos,
                              int dest_pos,
                              int len)
        Specified by:
        toArray in interface gnu.trove.list.TByteList
      • forEach

        public boolean forEach​(gnu.trove.procedure.TByteProcedure procedure)
        Specified by:
        forEach in interface gnu.trove.TByteCollection
        Specified by:
        forEach in interface gnu.trove.list.TByteList
      • forEachDescending

        public boolean forEachDescending​(gnu.trove.procedure.TByteProcedure procedure)
        Specified by:
        forEachDescending in interface gnu.trove.list.TByteList
      • sort

        public void sort()
        Specified by:
        sort in interface gnu.trove.list.TByteList
      • sort

        public void sort​(int fromIndex,
                         int toIndex)
        Specified by:
        sort in interface gnu.trove.list.TByteList
      • fill

        public void fill​(byte val)
        Specified by:
        fill in interface gnu.trove.list.TByteList
      • fill

        public void fill​(int fromIndex,
                         int toIndex,
                         byte val)
        Specified by:
        fill in interface gnu.trove.list.TByteList
      • binarySearch

        public int binarySearch​(byte value)
        Specified by:
        binarySearch in interface gnu.trove.list.TByteList
      • binarySearch

        public int binarySearch​(byte value,
                                int fromIndex,
                                int toIndex)
        Specified by:
        binarySearch in interface gnu.trove.list.TByteList
      • indexOf

        public int indexOf​(byte value)
        Specified by:
        indexOf in interface gnu.trove.list.TByteList
      • indexOf

        public int indexOf​(int offset,
                           byte value)
        Specified by:
        indexOf in interface gnu.trove.list.TByteList
      • lastIndexOf

        public int lastIndexOf​(byte value)
        Specified by:
        lastIndexOf in interface gnu.trove.list.TByteList
      • lastIndexOf

        public int lastIndexOf​(int offset,
                               byte value)
        Specified by:
        lastIndexOf in interface gnu.trove.list.TByteList
      • contains

        public boolean contains​(byte value)
        Specified by:
        contains in interface gnu.trove.TByteCollection
        Specified by:
        contains in interface gnu.trove.list.TByteList
      • iterator

        public gnu.trove.iterator.TByteIterator iterator()
        Specified by:
        iterator in interface gnu.trove.TByteCollection
      • grep

        public gnu.trove.list.TByteList grep​(gnu.trove.procedure.TByteProcedure condition)
        Specified by:
        grep in interface gnu.trove.list.TByteList
      • inverseGrep

        public gnu.trove.list.TByteList inverseGrep​(gnu.trove.procedure.TByteProcedure condition)
        Specified by:
        inverseGrep in interface gnu.trove.list.TByteList
      • max

        public byte max()
        Specified by:
        max in interface gnu.trove.list.TByteList
      • min

        public byte min()
        Specified by:
        min in interface gnu.trove.list.TByteList
      • sum

        public byte sum()
        Specified by:
        sum in interface gnu.trove.list.TByteList
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface gnu.trove.TByteCollection
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface gnu.trove.TByteCollection
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object