Class RingBufferList<A>

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

    public class RingBufferList<A>
    extends java.lang.Object
    implements java.util.List<A>, java.io.Serializable
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int end  
      private static long serialVersionUID  
      private int start  
      private java.lang.Object[] values  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, A element)  
      boolean add​(A a)  
      boolean addAll​(int index, java.util.Collection<? extends A> c)  
      boolean addAll​(java.util.Collection<? extends A> c)  
      void addFirst​(A a)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      A get​(int index)  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator<A> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<A> listIterator()  
      java.util.ListIterator<A> listIterator​(int index)  
      int maxSize()  
      A remove​(int index)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      A set​(int index, A a)  
      int size()  
      java.util.List<A> subList​(int fromIndex, int toIndex)  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, 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

        equals, hashCode, replaceAll, sort, spliterator
    • Field Detail

      • start

        private int start
      • end

        private int end
      • values

        private java.lang.Object[] values
    • Constructor Detail

      • RingBufferList

        public RingBufferList()
      • RingBufferList

        public RingBufferList​(int maximumSize)
    • Method Detail

      • maxSize

        public int maxSize()
      • add

        public boolean add​(A a)
        Specified by:
        add in interface java.util.Collection<A>
        Specified by:
        add in interface java.util.List<A>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<A>
        Specified by:
        size in interface java.util.List<A>
      • toString

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

        public void addFirst​(A a)
      • get

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

        public A set​(int index,
                     A a)
        Specified by:
        set in interface java.util.List<A>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<A>
        Specified by:
        clear in interface java.util.List<A>
      • add

        public void add​(int index,
                        A element)
        Specified by:
        add in interface java.util.List<A>
      • addAll

        public boolean addAll​(java.util.Collection<? extends A> c)
        Specified by:
        addAll in interface java.util.Collection<A>
        Specified by:
        addAll in interface java.util.List<A>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends A> c)
        Specified by:
        addAll in interface java.util.List<A>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<A>
        Specified by:
        contains in interface java.util.List<A>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<A>
        Specified by:
        containsAll in interface java.util.List<A>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<A>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<A>
        Specified by:
        isEmpty in interface java.util.List<A>
      • iterator

        public java.util.Iterator<A> iterator()
        Specified by:
        iterator in interface java.util.Collection<A>
        Specified by:
        iterator in interface java.lang.Iterable<A>
        Specified by:
        iterator in interface java.util.List<A>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<A>
      • listIterator

        public java.util.ListIterator<A> listIterator()
        Specified by:
        listIterator in interface java.util.List<A>
      • listIterator

        public java.util.ListIterator<A> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<A>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<A>
        Specified by:
        remove in interface java.util.List<A>
      • remove

        public A remove​(int index)
        Specified by:
        remove in interface java.util.List<A>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<A>
        Specified by:
        removeAll in interface java.util.List<A>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<A>
        Specified by:
        retainAll in interface java.util.List<A>
      • subList

        public java.util.List<A> subList​(int fromIndex,
                                         int toIndex)
        Specified by:
        subList in interface java.util.List<A>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<A>
        Specified by:
        toArray in interface java.util.List<A>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<A>
        Specified by:
        toArray in interface java.util.List<A>