Class IntrusiveStack<T extends IntrusiveStack<T>>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    java.lang.Iterable<T>
    Direct Known Subclasses:
    FailureRecordingCallback.FailureResponses

    public class IntrusiveStack<T extends IntrusiveStack<T>>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    An efficient stack/list that is expected to be ordinarily either empty or close to, and for which we need concurrent insertions and do not need to support removal - i.e. the list is semi immutable. This is an intrusive stack, and for simplicity we treat all
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static interface  IntrusiveStack.Setter<O,​T>  
    • Constructor Summary

      Constructors 
      Constructor Description
      IntrusiveStack()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static <T extends IntrusiveStack<T>>
      long
      accumulate​(T list, LongAccumulator<T> accumulator, long initialValue)  
      void forEach​(java.util.function.Consumer<? super T> forEach)  
      protected static <T extends IntrusiveStack<T>>
      void
      forEach​(T list, java.util.function.Consumer<? super T> forEach)  
      protected static <T extends IntrusiveStack<T>,​O>
      java.lang.Iterable<T>
      iterable​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater, O owner)  
      protected static <T extends IntrusiveStack<T>>
      java.lang.Iterable<T>
      iterable​(T list)  
      java.util.Iterator<T> iterator()  
      protected static <T extends IntrusiveStack<T>>
      java.util.Iterator<T>
      iterator​(T list)  
      protected static <O,​T extends IntrusiveStack<T>>
      T
      push​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<? super O,​T> headUpdater, O owner, T prepend)  
      protected static <O,​T extends IntrusiveStack<T>>
      T
      push​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,​T,​T> combine)  
      protected static <O,​T extends IntrusiveStack<T>>
      T
      push​(java.util.function.Function<O,​T> getter, IntrusiveStack.Setter<O,​T> setter, O owner, T prepend)  
      protected static <O,​T extends IntrusiveStack<T>>
      T
      push​(java.util.function.Function<O,​T> getter, IntrusiveStack.Setter<O,​T> setter, O owner, T prepend, java.util.function.BiFunction<T,​T,​T> combine)  
      protected static <T extends IntrusiveStack<T>,​O>
      void
      pushExclusive​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater, O owner, T prepend)  
      protected static <O,​T extends IntrusiveStack<T>>
      void
      pushExclusive​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater, O owner, T prepend, java.util.function.BiFunction<T,​T,​T> combine)  
      protected static <T extends IntrusiveStack<T>>
      T
      pushExclusive​(T head, T prepend)  
      protected T reverse()  
      protected static <T extends IntrusiveStack<T>>
      T
      reverse​(T list)  
      protected static int size​(IntrusiveStack<?> list)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        spliterator
    • Constructor Detail

      • IntrusiveStack

        public IntrusiveStack()
    • Method Detail

      • push

        @Inline
        protected static <O,​T extends IntrusiveStack<T>> T push​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<? super O,​T> headUpdater,
                                                                      O owner,
                                                                      T prepend)
      • push

        protected static <O,​T extends IntrusiveStack<T>> T push​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater,
                                                                      O owner,
                                                                      T prepend,
                                                                      java.util.function.BiFunction<T,​T,​T> combine)
      • push

        @Inline
        protected static <O,​T extends IntrusiveStack<T>> T push​(java.util.function.Function<O,​T> getter,
                                                                      IntrusiveStack.Setter<O,​T> setter,
                                                                      O owner,
                                                                      T prepend)
      • push

        protected static <O,​T extends IntrusiveStack<T>> T push​(java.util.function.Function<O,​T> getter,
                                                                      IntrusiveStack.Setter<O,​T> setter,
                                                                      O owner,
                                                                      T prepend,
                                                                      java.util.function.BiFunction<T,​T,​T> combine)
      • pushExclusive

        protected static <O,​T extends IntrusiveStack<T>> void pushExclusive​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater,
                                                                                  O owner,
                                                                                  T prepend,
                                                                                  java.util.function.BiFunction<T,​T,​T> combine)
      • pushExclusive

        protected static <T extends IntrusiveStack<T>,​O> void pushExclusive​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater,
                                                                                  O owner,
                                                                                  T prepend)
      • pushExclusive

        protected static <T extends IntrusiveStack<T>> T pushExclusive​(T head,
                                                                       T prepend)
      • iterable

        protected static <T extends IntrusiveStack<T>,​O> java.lang.Iterable<T> iterable​(java.util.concurrent.atomic.AtomicReferenceFieldUpdater<O,​T> headUpdater,
                                                                                              O owner)
      • iterable

        protected static <T extends IntrusiveStack<T>> java.lang.Iterable<T> iterable​(T list)
      • iterator

        protected static <T extends IntrusiveStack<T>> java.util.Iterator<T> iterator​(T list)
      • reverse

        protected T reverse()
      • reverse

        protected static <T extends IntrusiveStack<T>> T reverse​(T list)
      • forEach

        public void forEach​(java.util.function.Consumer<? super T> forEach)
        Specified by:
        forEach in interface java.lang.Iterable<T extends IntrusiveStack<T>>
      • forEach

        protected static <T extends IntrusiveStack<T>> void forEach​(T list,
                                                                    java.util.function.Consumer<? super T> forEach)
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends IntrusiveStack<T>>