IntrusiveCollection.Element (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, class: IntrusiveCollection, interface: Element

Package org.apache.hadoop.util

# Interface IntrusiveCollection.Element

Enclosing class:
  IntrusiveCollection<E extends IntrusiveCollection.Element>

@Private public static interface IntrusiveCollection.Element
An element contained in this list. We pass the list itself as a parameter so that elements can belong to multiple lists. (The element will need to store separate prev and next pointers for each.)

- ## Method Summary

  Modifier and Type
  Method
  Description
  `IntrusiveCollection.Element`
  `getNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list)`
  Get the next pointer of an element.
  `IntrusiveCollection.Element`
  `getPrev(IntrusiveCollection<? extends IntrusiveCollection.Element> list)`
  Get the prev pointer of an element.
  `void`
  `insertInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element prev, IntrusiveCollection.Element next)`
  Insert this element into the list.
  `boolean`
  `isInList(IntrusiveCollection<? extends IntrusiveCollection.Element> list)`
  Returns true if this element is in the provided list.
  `void`
  `removeInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list)`
  Remove an element from the list.
  `void`
  `setNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element next)`
  Set the next pointer of an element already in the list.
  `void`
  `setPrev(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element prev)`
  Set the prev pointer of an element already in the list.

- ## Method Details

  - ### insertInternal

    void insertInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element prev, IntrusiveCollection.Element next)
    Insert this element into the list. This is the first thing that will be called on the element.
    Parameters:
      `list` - list.
      `prev` - prev.
      `next` - next.

  - ### setPrev

    void setPrev(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element prev)
    Set the prev pointer of an element already in the list.
    Parameters:
      `list` - list.
      `prev` - prev.

  - ### setNext

    void setNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element next)
    Set the next pointer of an element already in the list.
    Parameters:
      `list` - list.
      `next` - next.

  - ### removeInternal

    void removeInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list)
    Remove an element from the list. This is the last thing that will be called on an element.
    Parameters:
      `list` - list.

  - ### getPrev

    IntrusiveCollection.Element getPrev(IntrusiveCollection<? extends IntrusiveCollection.Element> list)
    Get the prev pointer of an element.
    Parameters:
      `list` - list.
    Returns:
      Element.

  - ### getNext

    IntrusiveCollection.Element getNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list)
    Get the next pointer of an element.
    Parameters:
      `list` - list.
    Returns:
      Element.

  - ### isInList

    boolean isInList(IntrusiveCollection<? extends IntrusiveCollection.Element> list)
    Returns true if this element is in the provided list.
    Parameters:
      `list` - list.
    Returns:
      if this element is in the provided list true, not false.