Class IntrusiveLinkedListImpl
java.lang.Object
express.mvp.roray.utils.collections.IntrusiveLinkedListImpl
- All Implemented Interfaces:
IntrusiveLinkedList, AutoCloseable
An intrusive linked list implementation using off-heap memory segments.
This implementation uses the memory segment's own memory to store the next pointer, avoiding separate node allocations.
-
Constructor Details
-
IntrusiveLinkedListImpl
public IntrusiveLinkedListImpl(long nextOffset) -
IntrusiveLinkedListImpl
public IntrusiveLinkedListImpl()
-
-
Method Details
-
add
Description copied from interface:IntrusiveLinkedListAdds an element to the tail of the list.- Specified by:
addin interfaceIntrusiveLinkedList- Parameters:
segment- The memory segment representing the element.
-
poll
Description copied from interface:IntrusiveLinkedListRemoves and returns the head of the list.- Specified by:
pollin interfaceIntrusiveLinkedList- Returns:
- The memory segment of the head, or null if empty.
-
size
public int size()- Specified by:
sizein interfaceIntrusiveLinkedList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIntrusiveLinkedList
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceIntrusiveLinkedList
-