ParentSize

com.phasmidsoftware.gryphon.adjunct.ParentSize
See theParentSize companion object
case class ParentSize[V](parent: Option[V], size: Int)

Carries an optional parent reference and the size of the component tree.

Type parameters

V

the underlying object type.

Value parameters

parent

None if this object is a root; Some(p) otherwise.

size

the number of objects in this component tree (meaningful only at the root). With path compression active, this becomes an upper bound on depth (rank) rather than the precise tree size.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def reparent(vo: Option[V]): ParentSize[V]

Creates a new instance of ParentSize with an updated parent reference.

Creates a new instance of ParentSize with an updated parent reference.

Value parameters

vo

The new parent reference to be set. Use None to indicate no parent (root node) or Some(v) to set a specific parent v.

Attributes

Returns

A new ParentSize[V] instance with the updated parent reference.

def resize(s: Int): ParentSize[V]

Creates a new instance of ParentSize with an updated size.

Creates a new instance of ParentSize with an updated size.

Value parameters

s

The new size of the component tree. This value represents either the number of objects in the tree (if at the root) or an upper bound on the tree's depth (rank) when path compression is active.

Attributes

Returns

A new ParentSize[V] instance with the updated size.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product