|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.hawaii.ics.yucheng.JadeSolver.VertexNode
class JadeSolver.VertexNode
Implementation of a vertex node. Each node holds a vertex index, weight, a list of connected vertices, and an array that provides O(1) time to determine if another vertex is connected.
Field Summary | |
---|---|
int |
index
The index of the vertex. |
private JadeSolver.GraphData |
myGraph
|
private int |
myHops
|
private java.util.Collection<JadeSolver.VertexNode> |
myNeighborCache
|
float |
weight
The weight of the vertex. |
Constructor Summary | |
---|---|
JadeSolver.VertexNode(JadeSolver.GraphData g,
int index)
Initializes a new instance of the class. |
Method Summary | |
---|---|
int |
degree()
Returns the degree (the number of edges). |
int |
hops()
Returns the number of hops. |
java.util.Collection<JadeSolver.VertexNode> |
neighbors()
Returns a collection of neighboring vertices. |
void |
setHops(int hops)
Sets the number of hops associated with this vertex to the root. |
java.lang.String |
toString()
Returns the string representation of the class data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int index
private final JadeSolver.GraphData myGraph
private int myHops
private java.util.Collection<JadeSolver.VertexNode> myNeighborCache
public final float weight
Constructor Detail |
---|
public JadeSolver.VertexNode(JadeSolver.GraphData g, int index)
g
- The graph data.index
- The vertex index for this instance.Method Detail |
---|
public int degree()
public int hops()
public java.util.Collection<JadeSolver.VertexNode> neighbors()
public void setHops(int hops)
hops
- The number of hops.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |