Class TIntListDecorator

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.List<java.lang.Integer>

    public class TIntListDecorator
    extends java.util.AbstractList<java.lang.Integer>
    implements java.util.List<java.lang.Integer>, java.io.Externalizable, java.lang.Cloneable
    Wrapper class to make a TIntList conform to the java.util.List API. This class simply decorates an underlying TIntList and translates the Object-based APIs into their Trove primitive analogs.

    Note that wrapping and unwrapping primitive values is extremely inefficient. If possible, users of this class should override the appropriate methods in this class and use a table of canonical values.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected TIntList list
      the wrapped primitive list
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, java.lang.Integer value)  
      java.lang.Integer get​(int index)  
      TIntList getList()
      Returns a reference to the list wrapped by this decorator.
      void readExternal​(java.io.ObjectInput in)  
      java.lang.Integer remove​(int index)  
      java.lang.Integer set​(int index, java.lang.Integer value)  
      int size()  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.util.AbstractList

        add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

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

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArray
    • Field Detail

      • list

        protected TIntList list
        the wrapped primitive list
    • Constructor Detail

      • TIntListDecorator

        public TIntListDecorator()
        FOR EXTERNALIZATION ONLY!!
      • TIntListDecorator

        public TIntListDecorator​(TIntList list)
        Creates a wrapper that decorates the specified primitive map.
        Parameters:
        list - the TIntList to wrap.
    • Method Detail

      • getList

        public TIntList getList()
        Returns a reference to the list wrapped by this decorator.
        Returns:
        the wrapped TIntList instance.
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Integer>
        Specified by:
        size in interface java.util.List<java.lang.Integer>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.Integer>
      • get

        public java.lang.Integer get​(int index)
        Specified by:
        get in interface java.util.List<java.lang.Integer>
        Specified by:
        get in class java.util.AbstractList<java.lang.Integer>
      • set

        public java.lang.Integer set​(int index,
                                     java.lang.Integer value)
        Specified by:
        set in interface java.util.List<java.lang.Integer>
        Overrides:
        set in class java.util.AbstractList<java.lang.Integer>
      • add

        public void add​(int index,
                        java.lang.Integer value)
        Specified by:
        add in interface java.util.List<java.lang.Integer>
        Overrides:
        add in class java.util.AbstractList<java.lang.Integer>
      • remove

        public java.lang.Integer remove​(int index)
        Specified by:
        remove in interface java.util.List<java.lang.Integer>
        Overrides:
        remove in class java.util.AbstractList<java.lang.Integer>
      • 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
      • writeExternal

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