OrderableEdge

com.phasmidsoftware.gryphon.core.OrderableEdge
trait OrderableEdge[V, E] extends Edge[V, E], Ordered[Edge[V, E]]

A trait that represents an ordered edge in a graph structure.

Extends the Edge interface by providing an ordering mechanism based on the edge's attribute of type E. It also implements the Scala Ordered trait to enable comparisons between edges.

Type parameters

E

the type of the attribute associated with the edge. This attribute is used for determining the order of the edges.

V

the type of the vertices connected by the edge.

Attributes

Graph
Supertypes
trait Ordered[Edge[V, E]]
trait Comparable[Edge[V, E]]
trait Edge[V, E]
trait Connexion[V]
trait Attribute[E]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def compare(that: Edge[V, E])(implicit ordering: Ordering[E]): Int

Compares this edge with another edge based on their attributes using the specified ordering.

Compares this edge with another edge based on their attributes using the specified ordering.

Value parameters

ordering

the implicit ordering instance that defines the comparison behavior for the edge attributes.

that

the edge to compare against.

Attributes

Returns

an integer where a negative value indicates this edge's attribute is less than the other edge's attribute, zero indicates they are equal, and a positive value indicates this edge's attribute is greater.

Inherited methods

def <(that: Edge[V, E]): Boolean

Returns true if this is less than that

Returns true if this is less than that

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def <=(that: Edge[V, E]): Boolean

Returns true if this is less than or equal to that.

Returns true if this is less than or equal to that.

Attributes

Inherited from:
Ordered
def >(that: Edge[V, E]): Boolean

Returns true if this is greater than that.

Returns true if this is greater than that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered
def >=(that: Edge[V, E]): Boolean

Returns true if this is greater than or equal to that.

Returns true if this is greater than or equal to that.

Attributes

Inherited from:
Ordered
def compareTo(that: Edge[V, E]): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Value parameters

that

the instance to compare against

Attributes

Inherited from:
Ordered

Inherited and Abstract methods

def attribute: E

Retrieves the attribute of type A associated with this instance.

Retrieves the attribute of type A associated with this instance.

Attributes

Returns

the attribute of type A representing the defining characteristic or property of this instance.

Inherited from:
Attribute
def black: V

Retrieves the black Vertex of this Connexion. If this is a DirectedEdge, this vertex represents the end. If this is an UndirectedEdge, see the note above for white.

Retrieves the black Vertex of this Connexion. If this is a DirectedEdge, this vertex represents the end. If this is an UndirectedEdge, see the note above for white.

Attributes

Returns

the "black" vertex.

Inherited from:
Connexion
def compare(that: Edge[V, E]): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Implement this method to determine how instances of A will be sorted.

Returns x where:

  • x &lt; 0 when this &lt; that

  • x == 0 when this == that

  • x > 0 when this > that

Value parameters

that

the instance to compare against

Attributes

Returns

an integer whose sign indicates the ordering relation between this and that

Inherited from:
Ordered

Retrieves the type of the edge (e.g., directed or undirected).

Retrieves the type of the edge (e.g., directed or undirected).

Attributes

Returns

an instance of EdgeType that describes whether the edge is directed (one-way) or undirected (two-way).

Inherited from:
Edge
def white: V

Retrieves the white Vertex of this Connexion. If this is a DirectedEdge, this vertex represents the start. If this is an UndirectedEdge, white to black represents the nominal direction. Individual adjacencies can be based on a flipped version of an UndirectedEdge.

Retrieves the white Vertex of this Connexion. If this is a DirectedEdge, this vertex represents the start. If this is an UndirectedEdge, white to black represents the nominal direction. Individual adjacencies can be based on a flipped version of an UndirectedEdge.

Attributes

Returns

the "white" vertex.

Inherited from:
Connexion