MirroredEdgeCollection

This interface can be used for edge collections, which "mirror" its content to another property. This can be used to automatically populate next/prev flow edges.

Inheritors

Properties

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
abstract var init: (start: Node, end: NodeType) -> PropertyEdgeType
Link copied to clipboard
Link copied to clipboard
abstract var onAdd: (PropertyEdgeType) -> Unit?
Link copied to clipboard
abstract var onRemove: (PropertyEdgeType) -> Unit?
Link copied to clipboard
abstract var outgoing: Boolean
Link copied to clipboard
abstract val size: Int
Link copied to clipboard
abstract var thisRef: Node

Functions

Link copied to clipboard
open fun add(target: NodeType, init: (Node, NodeType) -> PropertyEdgeType = this.init, builder: PropertyEdgeType.() -> Unit? = null): Boolean

Creates a new edge with the target node and an optional builder to include edge properties. If outgoing is true, the edge is created from thisRef ->target, otherwise from target to thisRef.

abstract fun add(element: PropertyEdgeType): Boolean
Link copied to clipboard
open fun addAll(targets: Collection<NodeType>, builder: PropertyEdgeType.() -> Unit? = null): Boolean
abstract fun addAll(elements: Collection<PropertyEdgeType>): Boolean
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
abstract fun clear()
Link copied to clipboard
open fun contains(target: NodeType): Boolean
abstract operator fun contains(element: PropertyEdgeType): Boolean
Link copied to clipboard
Link copied to clipboard
open fun <NodeType : Node, PropertyEdgeType : Edge<NodeType>> createEdge(target: NodeType, init: (Node, NodeType) -> PropertyEdgeType, outgoing: Boolean = true, builder: PropertyEdgeType.() -> Unit? = null): PropertyEdgeType
Link copied to clipboard
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 handleOnAdd(edge: PropertyEdgeType)

Adds this particular edge to its mirrorProperty. We need the information if this is an outgoing or incoming edge collection.

Link copied to clipboard
open override fun handleOnRemove(edge: PropertyEdgeType)

This function will be executed after an edge was removed from the container. This can be used to unregister additional handlers, e.g. a TypeObserver.

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.

Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): MutableIterator<PropertyEdgeType>
Link copied to clipboard
Link copied to clipboard
open operator fun plusAssign(end: NodeType)
Link copied to clipboard
open fun remove(target: NodeType): Boolean

Removes all edges with the target node. The target is considered to be either the Edge.end or Edge.start depending on outgoing.

abstract fun remove(element: PropertyEdgeType): Boolean
Link copied to clipboard
abstract fun removeAll(elements: Collection<PropertyEdgeType>): Boolean
Link copied to clipboard
Link copied to clipboard
open fun resetTo(nodes: Collection<NodeType>)

Clears the collection and adds the nodes.

Link copied to clipboard
abstract fun retainAll(elements: Collection<PropertyEdgeType>): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
Link copied to clipboard
abstract fun toNodeCollection(predicate: (PropertyEdgeType) -> Boolean? = null): Collection<NodeType>

Converts this collection of edges into a collection of nodes for easier access to the "target" nodes.

Link copied to clipboard

Returns an UnwrappedEdgeCollection magic container which holds a structure that provides easy access to the "target" nodes without edge information, but is mutable and in-sync with this collection.