T- item type
public class ResettableSingletonTraverser<T> extends Object implements Traverser<T>, Consumer<T>
Consumer<T>. Another item can be set at any time and the subsequent
next()call will consume it. However, if this traverser already has an item, it is illegal to set another one before consuming it.
AppendableTraverser if you have more items to traverse.
|Constructor and Description|
|Modifier and Type||Method and Description|
Resets this traverser so that the following
Returns the next item, removing it from this traverser.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append, dropWhile, filter, flatMap, map, onFirstNull, peek, prepend, takeWhile
public T next()
null. If this traverser is null-terminated, getting a
nullmeans it's exhausted and will keep returning
nullforever. Otherwise, trying again later may produce one.
public void accept(@Nullable T item)
next()call will return the item supplied here. If the traverser already has an item, it is illegal to call this method until that item is consumed by calling
Copyright © 2022 Hazelcast, Inc.. All rights reserved.