Package org.apache.jena.ontology
Class OntTools.DisjointSet
- java.lang.Object
-
- org.apache.jena.ontology.OntTools.DisjointSet
-
- Enclosing class:
- OntTools
public static class OntTools.DisjointSet extends java.lang.Object
A simple representation of disjoint sets
-
-
Constructor Summary
Constructors Constructor Description DisjointSet(Resource node)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OntTools.DisjointSet
find()
The find operation collapses the pointer to the root parent, which is one of Tarjan's standard optimisations.OntTools.DisjointSet
getAncestor()
Resource
getNode()
OntTools.DisjointSet
getParent()
int
getRank()
void
incrementRank()
boolean
isBlack()
void
setAncestor(OntTools.DisjointSet anc)
void
setBlack()
void
setParent(OntTools.DisjointSet parent)
void
setUsed()
java.lang.String
toShortString()
java.lang.String
toString()
void
union(OntTools.DisjointSet y)
The union of two setsboolean
used()
-
-
-
Constructor Detail
-
DisjointSet
public DisjointSet(Resource node)
-
-
Method Detail
-
getNode
public Resource getNode()
-
getParent
public OntTools.DisjointSet getParent()
-
setParent
public void setParent(OntTools.DisjointSet parent)
-
getRank
public int getRank()
-
incrementRank
public void incrementRank()
-
getAncestor
public OntTools.DisjointSet getAncestor()
-
setAncestor
public void setAncestor(OntTools.DisjointSet anc)
-
setBlack
public void setBlack()
-
isBlack
public boolean isBlack()
-
used
public boolean used()
-
setUsed
public void setUsed()
-
find
public OntTools.DisjointSet find()
The find operation collapses the pointer to the root parent, which is one of Tarjan's standard optimisations.- Returns:
- The representative of the union containing this set
-
union
public void union(OntTools.DisjointSet y)
The union of two sets- Parameters:
y
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this set for debugging
- See Also:
Object.toString()
-
toShortString
public java.lang.String toShortString()
-
-