Class VarHandleQueueUtil


  • public final class VarHandleQueueUtil
    extends java.lang.Object
    • Field Detail

      • ARRAY_REF_ELEMENT

        private static final java.lang.invoke.VarHandle ARRAY_REF_ELEMENT
      • ARRAY_LONG_ELEMENT

        private static final java.lang.invoke.VarHandle ARRAY_LONG_ELEMENT
    • Constructor Detail

      • VarHandleQueueUtil

        public VarHandleQueueUtil()
    • Method Detail

      • lvRefElement

        public static <E> E lvRefElement​(E[] buffer,
                                         long offset)
      • laRefElement

        public static <E> E laRefElement​(E[] buffer,
                                         long offset)
      • lpRefElement

        public static <E> E lpRefElement​(E[] buffer,
                                         long offset)
      • spRefElement

        public static <E> void spRefElement​(E[] buffer,
                                            long offset,
                                            E value)
      • soRefElement

        public static <E> void soRefElement​(E[] buffer,
                                            long offset,
                                            E value)
      • svRefElement

        public static <E> void svRefElement​(E[] buffer,
                                            long offset,
                                            E value)
      • calcRefElementOffset

        public static long calcRefElementOffset​(long index)
      • calcCircularRefElementOffset

        public static long calcCircularRefElementOffset​(long index,
                                                        long mask)
      • allocateRefArray

        public static <E> E[] allocateRefArray​(int capacity)
      • spLongElement

        public static void spLongElement​(long[] buffer,
                                         long offset,
                                         long e)
      • soLongElement

        public static void soLongElement​(long[] buffer,
                                         long offset,
                                         long e)
      • lpLongElement

        public static long lpLongElement​(long[] buffer,
                                         long offset)
      • laLongElement

        public static long laLongElement​(long[] buffer,
                                         long offset)
      • lvLongElement

        public static long lvLongElement​(long[] buffer,
                                         long offset)
      • calcCircularLongElementOffset

        public static long calcCircularLongElementOffset​(long index,
                                                         long mask)
      • allocateLongArray

        public static long[] allocateLongArray​(int capacity)
      • length

        public static int length​(java.lang.Object[] buf)
      • modifiedCalcCircularRefElementOffset

        public static long modifiedCalcCircularRefElementOffset​(long index,
                                                                long mask)
        This method assumes index is actually (index << 1) because lower bit is used for resize hence the >> 1
      • nextArrayOffset

        public static long nextArrayOffset​(java.lang.Object[] curr)