Class CyclicBuffer<E>


  • @Deprecated(since="2022-01-27")
    public class CyclicBuffer<E>
    extends java.lang.Object
    Deprecated.
    This internal logback API is not supported by AEM as a Cloud Service.
    CyclicBuffer holds values in a cyclic array.

    It allows read access to any element in the buffer not just the first or last element.

    • Constructor Summary

      Constructors 
      Constructor Description
      CyclicBuffer​(int maxSize)
      Deprecated.
      Instantiate a new CyclicBuffer of at most maxSize events.
      CyclicBuffer​(CyclicBuffer<E> other)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void add​(E event)
      Deprecated.
      Add an event as the last event in the buffer.
      java.util.List<E> asList()
      Deprecated.
       
      void clear()
      Deprecated.
      Clears the buffer and resets all attributes.
      E get()
      Deprecated.
      Get the oldest (first) element in the buffer.
      E get​(int i)
      Deprecated.
      Get the ith oldest event currently in the buffer.
      int getMaxSize()
      Deprecated.
       
      int length()
      Deprecated.
      Get the number of elements in the buffer.
      void resize​(int newSize)
      Deprecated.
      Resize the cyclic buffer to newSize.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CyclicBuffer

        public CyclicBuffer​(int maxSize)
                     throws java.lang.IllegalArgumentException
        Deprecated.
        Instantiate a new CyclicBuffer of at most maxSize events. The maxSize argument must a positive integer.
        Parameters:
        maxSize - The maximum number of elements in the buffer.
        Throws:
        java.lang.IllegalArgumentException
      • CyclicBuffer

        public CyclicBuffer​(CyclicBuffer<E> other)
        Deprecated.
    • Method Detail

      • clear

        public void clear()
        Deprecated.
        Clears the buffer and resets all attributes.
      • add

        public void add​(E event)
        Deprecated.
        Add an event as the last event in the buffer.
      • get

        public E get​(int i)
        Deprecated.
        Get the ith oldest event currently in the buffer. If i is outside the range 0 to the number of elements currently in the buffer, then null is returned.
      • getMaxSize

        public int getMaxSize()
        Deprecated.
      • get

        public E get()
        Deprecated.
        Get the oldest (first) element in the buffer. The oldest element is removed from the buffer.
      • asList

        public java.util.List<E> asList()
        Deprecated.
      • length

        public int length()
        Deprecated.
        Get the number of elements in the buffer. This number is guaranteed to be in the range 0 to maxSize (inclusive).
      • resize

        public void resize​(int newSize)
        Deprecated.
        Resize the cyclic buffer to newSize.
        Throws:
        java.lang.IllegalArgumentException - if newSize is negative.