UnwrappedEdgeList

An intelligent MutableList wrapper around an EdgeList which supports iterating, adding and removing Node elements.

Constructors

Link copied to clipboard
constructor(list: EdgeList<NodeType, EdgeType>)

Types

Link copied to clipboard
inner class Delegate<ThisType : Node>

This class can be used to implement delegated properties in Node classes. The most common use case is to have a property that is a list of Edge objects (for persistence) and a second (delegated) property that allows easy access just to the connected nodes of the individual edges for in-memory access. It should not be used directly, but rather by using unwrapping.

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

This computed property returns the common type in a Collection of Type objects. For example, if two types A and B both derive from the interface C`` then C` would be returned.

Link copied to clipboard
Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
open override fun add(element: NodeType): Boolean
fun add(element: NodeType, builder: EdgeType.() -> Unit? = null): Boolean
open override fun add(index: Int, element: NodeType)
Link copied to clipboard
fun <EdgeType : Edge<Node>> MutableList<Node>.add(target: Node, builder: EdgeType.() -> Unit): Boolean
Link copied to clipboard
open override fun addAll(elements: Collection<NodeType>): Boolean
open override fun addAll(index: Int, elements: Collection<NodeType>): Boolean
Link copied to clipboard

Wraps the given Type into a chain of PointerTypes and ReferenceTypes, given the operations in TypeOperations.

Link copied to clipboard
fun <T : Node> Collection<T>?.byNameOrNull(lookup: String, modifier: SearchModifier): T?

This function returns the first node that matches the name on the supplied list of nodes.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun contains(element: NodeType): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<NodeType>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): NodeType
Link copied to clipboard
operator fun <T : Node> Collection<T>?.get(predicate: (T) -> Boolean, modifier: SearchModifier = SearchModifier.NONE): T?

A shortcut to call firstOrNull using the [] syntax.

operator fun <T : Node> Collection<T>?.get(lookup: String, modifier: SearchModifier = SearchModifier.NONE): T?

A shortcut to call byNameOrNull using the [] syntax.

Link copied to clipboard
open override fun indexOf(element: NodeType): Int
Link copied to clipboard
operator fun <T : Node> Collection<T>.invoke(predicate: (T) -> Boolean): List<T>

A shortcut invoke filter on a list of nodes.

operator fun <T : Node> Collection<T>.invoke(lookup: String): List<T>

A shortcut to filter a list of nodes by their name.

inline operator fun <T> List<Node>.invoke(i: Int = 0): T?

Returns the i-th item in this list (or null) and casts it to T.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<NodeType>
Link copied to clipboard
open override fun lastIndexOf(element: NodeType): Int
Link copied to clipboard
open override fun listIterator(index: Int): MutableListIterator<NodeType>
Link copied to clipboard
Link copied to clipboard
open override fun remove(element: NodeType): Boolean
Link copied to clipboard
open override fun removeAll(elements: Collection<NodeType>): Boolean
Link copied to clipboard
open override fun removeAt(index: Int): NodeType
Link copied to clipboard
Link copied to clipboard
open override fun retainAll(elements: Collection<NodeType>): Boolean
Link copied to clipboard
open operator override fun set(index: Int, element: NodeType): NodeType
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<NodeType>
Link copied to clipboard