Package org.graalvm.collections
Class SeqLockPrefixTree.Node
java.lang.Object
java.lang.Number
java.util.concurrent.atomic.AtomicLong
org.graalvm.collections.SeqLockPrefixTree.Node
- All Implemented Interfaces:
Serializable
- Enclosing class:
SeqLockPrefixTree
- Since:
- 22.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionat
(long key) Get existing (or create if missing) child with the given key.long
incValue()
Increment value.long
void
setValue
(long value) Set the value for theLockFreePrefixTree.Node
.<C> void
topDown
(C currentContext, BiFunction<C, Long, C> createContext, BiConsumer<C, Long> consumeValue) Traverse the tree top-down while maintaining a context.toString()
long
value()
Methods inherited from class java.util.concurrent.atomic.AtomicLong
accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Method Details
-
value
public long value()- Returns:
- The value of the
LockFreePrefixTree.Node
- Since:
- 22.3
-
incValue
public long incValue()Increment value.- Returns:
- newly incremented value of the
LockFreePrefixTree.Node
. - Since:
- 22.3
-
setValue
public void setValue(long value) Set the value for theLockFreePrefixTree.Node
.- Parameters:
value
- the new value.- Since:
- 22.3
-
at
Get existing (or create if missing) child with the given key.- Parameters:
key
- the key of the child.- Returns:
- The child with the given childKey.
- Since:
- 22.3
-
seqlockValue
public long seqlockValue()- Returns:
- the value of the seqlock.
- Since:
- 22.3
-
topDown
public <C> void topDown(C currentContext, BiFunction<C, Long, C> createContext, BiConsumer<C, Long> consumeValue) Traverse the tree top-down while maintaining a context. The context is a generic data structure corresponding to the depth of the traversal, i.e. given the currentContext and a createContext function, a new context is created for each visited child using the createContext function, starting with initialContext.- Type Parameters:
C
- The type of the context- Parameters:
currentContext
- The context for the root of the treecreateContext
- A function defining how the context for children is createdconsumeValue
- A function that consumes the nodes value- Since:
- 22.3
-
toString
- Overrides:
toString
in classAtomicLong
- Since:
- 22.3
-