StringTree

sealed trait StringTree

Holder of structured data consisting of named values. ValueHolder is immutable, so the set operations in this class return another ValueHolder and never modify the original ValueHolder.

A(a, B(b, c))

{ a: apple, B:{b:book, c:car} }

val n1 = EmptyNode.set("a", apple) => Node(a -> Leaf(apple))
val n2 = n1.set("B.b", "book") => Node(a -> Leaf(apple), B -> EmptyNode.set("b", "book")) => Node(a -> apple, B -> Node(b -> Leaf(book)))
val n3 = n2.set("B.c", "car") => Node(a -> apple, B -> Node(b -> Leaf(book), c -> Leaf(car)))

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def dfs(path: Path): Iterator[(Path, String)]

Depth first search iterator under the specified path

Depth first search iterator under the specified path

def get(path: Path): StringTree

Extract a part of the value holder under the path

Extract a part of the value holder under the path

Returns:

value holder under the path

def setNode(path: Path, node: StringTree): StringTree

Set a value at the specified path

Set a value at the specified path

Value parameters:
path

path

value

String value to set

Returns:

updated value holder

Concrete methods

def +(e: (Path, StringTree)): StringTree
def ++(it: Iterable[(Path, StringTree)]): StringTree
def dfs: Iterator[(Path, String)]

Depth first search iterator

Depth first search iterator

def dfs(path: String): Iterator[(Path, String)]

Depth first search iterator under the specified path

Depth first search iterator under the specified path

def get(path: String): StringTree

Extract a part of the value holder under the path

Extract a part of the value holder under the path

Returns:

value holder under the path

def isEmpty: Boolean
def set(path: String, value: String): StringTree

Set a value at the specified path

Set a value at the specified path

Value parameters:
path

string representation of Path

Returns:

updated value holder

def set(path: Path, value: String): StringTree
def toMsgPack: Array[Byte]