类 AtomicStack<T>


  • public class AtomicStack<T>
    extends Object
    A fixed-size atomic stack, useful for tracking multithreaded access to an object. When the stack is full on addition, it overrides the earliest content in the stack.
    API Note:
    Vanilla uses this for debugging purpose on paletted container and chunk holder's asynchronous access checks.
    Mappings:
    Namespace Name
    official age
    intermediary net/minecraft/class_5831
    named net/minecraft/util/thread/AtomicStack
    • 字段详细资料

      • contents

        private final AtomicReferenceArray<T> contents
        Mappings:
        Namespace Name Mixin selector
        official a Lage;a:Ljava/util/concurrent/atomic/AtomicReferenceArray;
        intermediary field_28810 Lnet/minecraft/class_5831;field_28810:Ljava/util/concurrent/atomic/AtomicReferenceArray;
        named contents Lnet/minecraft/util/thread/AtomicStack;contents:Ljava/util/concurrent/atomic/AtomicReferenceArray;
      • size

        private final AtomicInteger size
        Mappings:
        Namespace Name Mixin selector
        official b Lage;b:Ljava/util/concurrent/atomic/AtomicInteger;
        intermediary field_28811 Lnet/minecraft/class_5831;field_28811:Ljava/util/concurrent/atomic/AtomicInteger;
        named size Lnet/minecraft/util/thread/AtomicStack;size:Ljava/util/concurrent/atomic/AtomicInteger;
    • 构造器详细资料

      • AtomicStack

        public AtomicStack​(int maxSize)
        Mappings:
        Namespace Name Mixin selector
        official <init> Lage;<init>(I)V
        intermediary <init> Lnet/minecraft/class_5831;<init>(I)V
        named <init> Lnet/minecraft/util/thread/AtomicStack;<init>(I)V
    • 方法详细资料

      • push

        public void push​(T value)
        Adds a value to this stack.

        If the stack is already at full capacity, the earliest pushed item in the stack is discarded.

        参数:
        value - the value to add
        Mappings:
        Namespace Name Mixin selector
        official a Lage;a(Ljava/lang/Object;)V
        intermediary method_33721 Lnet/minecraft/class_5831;method_33721(Ljava/lang/Object;)V
        named push Lnet/minecraft/util/thread/AtomicStack;push(Ljava/lang/Object;)V
      • toList

        public List<T> toList()
        Builds a list of the contents of the stack.

        The more recently pushed elements will appear earlier in the returned list. The returned list is immutable and its size won't exceed this stack's size.

        返回:
        a list of contents
        Mappings:
        Namespace Name Mixin selector
        official a Lage;a()Ljava/util/List;
        intermediary method_33720 Lnet/minecraft/class_5831;method_33720()Ljava/util/List;
        named toList Lnet/minecraft/util/thread/AtomicStack;toList()Ljava/util/List;