|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.xact.analysis.util.UnionFindForest<Key,NodeData>
Key
- NodeData
- public abstract class UnionFindForest<Key,NodeData>
Maintains a set of disjoint sets (called components). A node belongs to exactly one component,
and components can be merged into larger components. Each component is associated with
some user data that can be accessed with getData(Object)
.
Constructor Summary | |
---|---|
UnionFindForest()
|
Method Summary | |
---|---|
boolean |
containsKey(Key key)
|
protected abstract NodeData |
defaultNodeData()
|
NodeData |
getData(Key key)
Returns the data associated with the specified key's component. |
Set<Key> |
getKeys()
|
Key |
getRepresentativeKey(Key key)
Returns the key representing the given key's component. |
NodeData |
merge(Key a,
Key b)
|
protected abstract NodeData |
mergeNodeData(NodeData a,
NodeData b)
Merges the data associated with two components when they are merged into one. |
void |
setData(Key key,
NodeData data)
Sets the data associated with the specified key's component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnionFindForest()
Method Detail |
---|
public boolean containsKey(Key key)
protected abstract NodeData defaultNodeData()
public NodeData getData(Key key)
public Set<Key> getKeys()
public Key getRepresentativeKey(Key key)
public NodeData merge(Key a, Key b)
protected abstract NodeData mergeNodeData(NodeData a, NodeData b)
a
- data from one componentb
- data from another component
public void setData(Key key, NodeData data)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |