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

public static final class SeqLockPrefixTree.Node extends AtomicLong
Since:
22.3
See Also:
  • 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 the LockFreePrefixTree.Node.
      Parameters:
      value - the new value.
      Since:
      22.3
    • at

      public SeqLockPrefixTree.Node at(long key)
      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 tree
      createContext - A function defining how the context for children is created
      consumeValue - A function that consumes the nodes value
      Since:
      22.3
    • toString

      public String toString()
      Overrides:
      toString in class AtomicLong
      Since:
      22.3