StateNode

class StateNode(val state: State)(source)

Represents a State in a TemplateJTreeModel.

By default, two States are equal if their fields are equal, regardless of their UUID. However, this is problematic for JTrees because a JTree cannot contain multiple objects that equal each other. The StateNode class thus "replaces" the equals of the contained State within the context of the JTree.

See also

Constructors

Link copied to clipboard
constructor(state: State)

Properties

Link copied to clipboard
val canHaveChildren: Boolean

true if and only if this node can have children.

Link copied to clipboard
var children: List<StateNode>

The child nodes contained in this node.

Link copied to clipboard

The state contained in this node.

Functions

Link copied to clipboard
fun canHaveChild(child: StateNode): Boolean

Returns true if and only if this node can have child as a child.

Link copied to clipboard
fun descendants(): List<StateNode>

The (recursive) descendants of this node in depth-first order (excluding this node itself), or an empty list if this node cannot have children.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Returns true if and only if the UUIDs of this' state and other's state are equal.

Link copied to clipboard
open override fun hashCode(): Int

Returns the hash code of the state's UUID.