final class GVCongruenceClass extends Object implements Iterable<ValueGraphVertex>
Modifier and Type | Field and Description |
---|---|
private Object |
label
A label representing a property of this congruence class.
|
private int |
nParameter
How many vertices in this congruence class represent parameters?
|
private ValueGraphVertex |
representativeV
A representative of the congruence class
- saves having to find one
|
private int |
valueNumber
A value number representing this congruence class.
|
private HashSet<ValueGraphVertex> |
vertices
The set of vertices in this congruence class
|
Constructor and Description |
---|
GVCongruenceClass(int valueNumber,
Object label)
Create a congruence class with a given representative value number
and label.
|
Modifier and Type | Method and Description |
---|---|
void |
addVertex(ValueGraphVertex v)
Add a vertex to this congruence class.
|
boolean |
containsParameter()
Do any of the vertices in this set represent a parameter?
|
Object |
getLabel() |
ValueGraphVertex |
getRepresentative()
Return a representative vertex for this congruence class.
|
int |
getValueNumber() |
Iterator<ValueGraphVertex> |
iterator()
Return an iterator over the vertices in this congruence class
|
void |
removeVertex(ValueGraphVertex v)
Remove a vertex from this congruence class.
|
int |
size()
Return the number of vertices in this class
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private final int valueNumber
private int nParameter
private final HashSet<ValueGraphVertex> vertices
private ValueGraphVertex representativeV
GVCongruenceClass(int valueNumber, Object label)
valueNumber
- the value number of the classlabel
- the label of the classpublic int getValueNumber()
public boolean containsParameter()
TODO: for efficiency, keep this information incrementally
public void addVertex(ValueGraphVertex v)
v
- the vertex to addpublic void removeVertex(ValueGraphVertex v)
v
- the vertex to removepublic ValueGraphVertex getRepresentative()
public Iterator<ValueGraphVertex> iterator()
iterator
in interface Iterable<ValueGraphVertex>
public int size()