org.modeshape.common.collection.ring

## Class TrailingPointer

- java.lang.Object
- - org.modeshape.common.collection.ring.Pointer
  - - org.modeshape.common.collection.ring.TrailingPointer

- All Implemented Interfaces:
    DependentOnPointers

      public class TrailingPointer
      extends Pointer
      implements DependentOnPointers

  A `Pointer` that will always stay behind a number of other `Pointer` instances, which can be safely and dynamically added or removed.

- - ### Field Summary

    - ### Fields inherited from class org.modeshape.common.collection.ring.Pointer

      `INITIAL_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrailingPointer(long initialValue, Pointer... stayBehinds)`
    `TrailingPointer(Pointer... stayBehinds)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `get()`
    `boolean` | `ignore(Pointer pointer)` Ignore the specified pointer that cursor had previously `stayed behind`.
    `void` | `stayBehind(Pointer... pointers)` Ensure that this cursor always remains behind the specified pointer.
    `String` | `toString()`

    - ### Methods inherited from class org.modeshape.common.collection.ring.Pointer

      `incrementAndGet, set`

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

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

- - ### Constructor Detail

    - #### TrailingPointer

          public TrailingPointer(Pointer... stayBehinds)

    - #### TrailingPointer

          public TrailingPointer(long initialValue,
                         Pointer... stayBehinds)

  - ### Method Detail

    - #### get

          public long get()

      Overrides:
        `get` in class `Pointer`

    - #### stayBehind

          public void stayBehind(Pointer... pointers)

      Description copied from interface: `DependentOnPointers`
      Ensure that this cursor always remains behind the specified pointer.
      Specified by:
        `stayBehind` in interface `DependentOnPointers`
      Parameters:
        `pointers` - the pointers that this cursor may not run past in the ring buffer

    - #### ignore

          public boolean ignore(Pointer pointer)

      Description copied from interface: `DependentOnPointers`
      Ignore the specified pointer that cursor had previously `stayed behind`. This should be called when the supplied pointer is removed from the ring buffer.
      Specified by:
        `ignore` in interface `DependentOnPointers`
      Parameters:
        `pointer` - the pointer that this cursor may no longer depend upon
      Returns:
        true if this cursor did depend on the supplied pointer and now no longer does, or false if this cursor never dependent upon the supplied pointer

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Pointer`

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