org.modeshape.common.collection.ring

## Class Pointers

- java.lang.Object
- - org.modeshape.common.collection.ring.Pointers

-     public class Pointers
      extends Object

  Static methods for atomically modifying an array of `Pointer` instances.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> void` | `add(T holder, AtomicReferenceFieldUpdater<T,Pointer[]> updater, Cursor cursor, Pointer... pointersToAdd)` Atomically add the specified `Pointer` instance(s) to an array known to the given updator.
    `static long` | `getMinimum(Pointer[] pointers, long minimum)`
    `static <T> boolean` | `remove(T holder, AtomicReferenceFieldUpdater<T,Pointer[]> updater, Pointer pointer)` Atomically remove the specified `Pointer` instance from an array known to the given updator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getMinimum

          public static long getMinimum(Pointer[] pointers,
                        long minimum)

    - #### add

          public static <T> void add(T holder,
                     AtomicReferenceFieldUpdater<T,Pointer[]> updater,
                     Cursor cursor,
                     Pointer... pointersToAdd)

      Atomically add the specified `Pointer` instance(s) to an array known to the given updator.
      Parameters:
        `holder` - the object that holds the array; may not be null
        `updater` - the updator of the array; may not be null
        `cursor` - the cursor that the pointers will follow; may be null if none of the pointers are to be changed
        `pointersToAdd` - the pointer(s) to be added to the existing pointers

    - #### remove

          public static <T> boolean remove(T holder,
                           AtomicReferenceFieldUpdater<T,Pointer[]> updater,
                           Pointer pointer)

      Atomically remove the specified `Pointer` instance from an array known to the given updator.
      Parameters:
        `holder` - the object that holds the array; may not be null
        `updater` - the updator of the array; may not be null
        `pointer` - the pointer to be removed from the existing pointers
      Returns:
        true if the pointer was removed, or false if the array never contained the pointer

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.