| |
|
| java.lang.Object java.lang.Throwable java.lang.Exception org.openide.util.TopologicalSortException
TopologicalSortException | final public class TopologicalSortException extends Exception (Code) | | Exception that signals that a topological sort failed due to
unsortable nature of the graph and that provides support for
reporting and recovering from that state.
author: Jaroslav Tulach since: 3.30 See Also: Utilities.topologicalSort |
Method Summary | |
public String | getMessage() | final public List | partialSort() Because the full sort was not possible, this methods
returns the best possible substitute for it that is available. | final public void | printStackTrace(java.io.PrintWriter w) Adds description why the graph cannot be sorted. | final public void | printStackTrace(java.io.PrintStream s) Adds description why the graph cannot be sorted. | public String | toString() | final public Set[] | topologicalSets() As the full topological sort cannot be finished due to cycles
in the graph this methods performs a partition topological sort.
First of all it identifies unsortable parts of the graph and
partitions the graph into sets of original objects. | final public Set[] | unsortableSets() The topological sort could not be finished as there
are some objects that are mutually refering to each other.
This methods finds such objects and partition them into
separate sets. |
partialSort | final public List partialSort()(Code) | | Because the full sort was not possible, this methods
returns the best possible substitute for it that is available.
list of partially sorted objects, the list can be freely modified |
printStackTrace | final public void printStackTrace(java.io.PrintWriter w)(Code) | | Adds description why the graph cannot be sorted.
Parameters: w - writer to write to |
printStackTrace | final public void printStackTrace(java.io.PrintStream s)(Code) | | Adds description why the graph cannot be sorted.
Parameters: s - stream to write to |
topologicalSets | final public Set[] topologicalSets()(Code) | | As the full topological sort cannot be finished due to cycles
in the graph this methods performs a partition topological sort.
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.
array of sorted sets that contain the original objects, eachobject from the original collection is exactly in one set, resultshall not be modified |
unsortableSets | final public Set[] unsortableSets()(Code) | | The topological sort could not be finished as there
are some objects that are mutually refering to each other.
This methods finds such objects and partition them into
separate sets. All objects in one set (transitively) refer to
each other and thus prevent the sort from succeding. As
there can be more of such "unsortable sets" an array
of them is returned.
array of sets that contain some of the original objects, resultshall not be modified |
|
|
|