NodeProp

class NodeProp<T>(val perNode: Boolean = false, val deserialize: (String) -> T? = null, val combine: (T, T) -> T? = null)

Each NodeType or individual Tree can have metadata associated with it in props. Instances of this class represent prop names.

Constructors

Link copied to clipboard
constructor(perNode: Boolean = false, deserialize: (String) -> T? = null, combine: (T, T) -> T? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val combine: (T, T) -> T?
Link copied to clipboard
val deserialize: (String) -> T?
Link copied to clipboard
val id: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun add(f: (NodeType) -> T?): NodePropSource<T>

Create a NodePropSource using a function that returns a value for each NodeType.

fun add(map: Map<String, T>): NodePropSource<T>

Create a NodePropSource that assigns a value for this prop to NodeTypes by name or by a predicate function.