public final class TopologicalSortException
extends java.lang.Exception
BaseMutexUtilities#topologicalSort,
Serialized Form| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getMessage() |
|
java.util.List |
partialSort() |
Because the full sort was not possible, this methods
returns the best possible substitute for it that is available.
|
void |
printStackTrace(java.io.PrintStream s) |
Adds description why the graph cannot be sorted.
|
void |
printStackTrace(java.io.PrintWriter w) |
Adds description why the graph cannot be sorted.
|
java.util.Set[] |
topologicalSets() |
As the full topological sort cannot be finished due to cycles
in the graph this methods performs a partition topological sort.
|
java.lang.String |
toString() |
|
java.util.Set[] |
unsortableSets() |
The topological sort could not be finished as there
are some objects that are mutually refering to each other.
|
public final java.util.List partialSort()
public final java.util.Set[] unsortableSets()
public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String toString()
toString in class java.lang.Throwablepublic final void printStackTrace(java.io.PrintWriter w)
printStackTrace in class java.lang.Throwablew - writer to write topublic final void printStackTrace(java.io.PrintStream s)
printStackTrace in class java.lang.Throwables - stream to write topublic final java.util.Set[] topologicalSets()
First of all it identifies unsortable parts of the graph and partitions the graph into sets of original objects. Each set contains objects that are mutually unsortable (there is a cycle between them). Then the topological sort is performed again on those sets, this sort succeeds because the graph of sets is DAG (all problematic edges were only between objects now grouped inside the sets) and the result forms the return value of this method.
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.