Class LinkedNode<T>
java.lang.Object
org.hibernate.search.util.common.data.impl.LinkedNode<T>
- Type Parameters:
T- The type of values stored in the list.
- All Implemented Interfaces:
Iterable<T>
A very simple, immutable data structure to represent singly linked lists.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanfindAndReverse(Predicate<T> valuePredicate) findAndReverse(Predicate<T> valuePredicate, LinkedNode<T> head) inthashCode()iterator()static <T> LinkedNode<T>of(T value) static <T> LinkedNode<T>of(T... values) stream()toString()
-
Field Details
-
value
-
last
-
-
Method Details
-
of
-
of
-
toString
-
equals
-
hashCode
public int hashCode() -
iterator
-
spliterator
- Specified by:
spliteratorin interfaceIterable<T>
-
stream
-
withHead
-
findAndReverse
- Parameters:
valuePredicate- A predicate to apply to node values.- Returns:
- An optional containing the path from the found node to the current head,
i.e. a reversed list of all values
from the first node to match the given predicate to the current head
(note: the list is purposely in reversed order compared to
this), or an empty optional if no matching value was found.
-
findAndReverse
-