class Graph[N] extends AbstractGraph[N]
Represents a mutable (multi-)graph with ordered edges.
Thread Safety
This class is not thread-safe!
- Source
- Graph.scala
- Alphabetic
- By Inheritance
- Graph
- AbstractGraph
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def --=(vs: IterableOnce[N]): Graph.this.type
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addEdge(s: N, t: N): Graph.this.type
Adds a new edge between the given vertices.
Adds a new edge between the given vertices.
(If the vertices were not previously added, they will be added.)
- def addEdge(e: (N, N)): Graph.this.type
Adds a new edge between the given vertices.
Adds a new edge between the given vertices.
(If the vertices were not previously added, they will be added.)
- def addVertice(n: N): Graph.this.type
Adds a new vertice.
- def andThen[A](g: (IterableOnce[N]) => A): (N) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(s: N): List[N]
Returns a given node's successor nodes.
Returns a given node's successor nodes.
- Definition Classes
- Graph → AbstractGraph → Function1
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asIterable: (N) => Iterable[N]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def compose[A](g: (A) => N): (A) => IterableOnce[N]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def leafNodes: Set[N]
All nodes which only have incoming dependencies/which have no successors.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty: Boolean
- Definition Classes
- AbstractGraph
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- val predecessors: LinkedHashMap[N, List[N]]
- def removeVertice(v: N): Graph.this.type
Removes the given vertice from this graph.
- def rootNodes(ignoreSelfRecursiveDependencies: Boolean = true): Set[N]
Returns the set of nodes with no incoming dependencies; self-dependencies are optionally ignored.
Returns the set of nodes with no incoming dependencies; self-dependencies are optionally ignored.
- ignoreSelfRecursiveDependencies
If true self-dependencies are ignored. This means that nodes that have a self dependency are considered as being root nodes if they have no further incoming dependencies.
- returns
The set of root nodes which can be freely mutated.
- Definition Classes
- AbstractGraph
scala> val g = org.opalj.graphs.Graph.empty[AnyRef] += ("a" -> "b") += ("b" -> "c") += ("b" -> "d") += ("a" -> "e") += ("f" -> "e") += ("y" -> "y") += ("a" -> "f") g: org.opalj.graphs.Graph[AnyRef] = Graph{ d => {} c => {} a => {f,e,b} b => {d,c} e => {} y => {y} f => {e} } scala> g.rootNodes(ignoreSelfRecursiveDependencies = true) res1: scala.collection.mutable.Set[AnyRef] = Set(a) scala> g.rootNodes(ignoreSelfRecursiveDependencies = false) res2: scala.collection.mutable.Set[AnyRef] = Set(y, a)
Example: - def sccs(filterSingletons: Boolean = false): Iterator[Iterator[N]]
- val successors: LinkedHashMap[N, List[N]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDot(dir: String = "forward", ranksep: String = "1.0", rankdir: String = "TB"): String
- Definition Classes
- AbstractGraph
- def toNodes: Iterable[Node]
- Definition Classes
- AbstractGraph
- def toString(): String
- Definition Classes
- AbstractGraph → Function1 → AnyRef → Any
- val vertices: Set[N]
- Definition Classes
- Graph → AbstractGraph
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated