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 TypeMethodDescriptiongetNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list) Get the next pointer of an element.getPrev(IntrusiveCollection<? extends IntrusiveCollection.Element> list) Get the prev pointer of an element.voidinsertInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element prev, IntrusiveCollection.Element next) Insert this element into the list.booleanisInList(IntrusiveCollection<? extends IntrusiveCollection.Element> list) Returns true if this element is in the provided list.voidremoveInternal(IntrusiveCollection<? extends IntrusiveCollection.Element> list) Remove an element from the list.voidsetNext(IntrusiveCollection<? extends IntrusiveCollection.Element> list, IntrusiveCollection.Element next) Set the next pointer of an element already in the list.voidsetPrev(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
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
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.
-