Modifier and Type | Class and Description |
---|---|
class |
AbstractGraph.EdgeIteratorWrapper |
class |
AbstractGraph.VertexIteratorWrapper |
Modifier and Type | Field and Description |
---|---|
static int |
BLACK
Named constant (0)
|
static int |
BLUE
Named constant (5)
|
static int |
GRAY
Named constant (2)
|
static int |
GREEN
Named constant (4)
|
static int |
GREY
Named constant (2)
|
static int |
NaN
NaN is used to represent a missing color or
weight.
|
static int |
RED
Named constant (3)
|
static int |
WHITE
Named constant (1)
|
Modifier and Type | Method and Description |
---|---|
Vertex |
addVertex()
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(float weight)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(float weight,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(int color,
float weight)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(int color,
float weight,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(int color,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(java.lang.String label)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(java.lang.String label,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(java.lang.String label,
int color,
float weight)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(java.lang.String label,
int color,
float weight,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
Vertex |
addVertex(java.lang.String label,
int color,
int index)
Adds a Vertex to this graph with the specified
attributes.
|
java.util.Iterator<Edge> |
edgeIterator()
Returns an Iterator over the edges of this graph.
|
java.lang.Iterable<Edge> |
edges()
Returns an Iterable over this graph's edges.
|
Vertex |
firstVertex()
Returns the first Vertex in this graph.
|
boolean |
isDiGraph() |
java.util.Iterator<Vertex> |
iterator()
Returns an Iterator over the vertices of this graph.
|
void |
removeVertex(Vertex vertex)
Removes the specified Vertex and all attached Edges
from this graph.
|
int |
size()
Returns the number of vertices in this graph.
|
java.lang.String |
toString()
Returns the string representation of this graph.
|
int |
vertexCount()
Returns the number of vertices in this graph.
|
java.util.Iterator<Vertex> |
vertexIterator()
Returns an Iterator over the vertices of this graph.
|
java.lang.Iterable<Vertex> |
vertices()
Returns an Iterable over this graph's vertices.
|
public static final int BLACK
public static final int WHITE
public static final int GRAY
public static final int GREY
public static final int RED
public static final int GREEN
public static final int BLUE
public static final int NaN
public boolean isDiGraph()
public int size()
public int vertexCount()
public Vertex addVertex(java.lang.String label, int color, float weight, int index)
label
- the label for the new Vertexcolor
- the color for the new Vertexweight
- the weight for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(java.lang.String label, int color, int index)
label
- the label for the new Vertexcolor
- the color for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(java.lang.String label, int index)
label
- the label for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(int index)
index
- the index for the new Vertexpublic Vertex addVertex(int color, float weight, int index)
color
- the color for the new Vertexweight
- the weight for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(int color, int index)
color
- the color for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(float weight, int index)
weight
- the weight for the new Vertexindex
- the index for the new Vertexpublic Vertex addVertex(java.lang.String label, int color, float weight)
label
- the label for the new Vertexcolor
- the color for the new Vertexweight
- the weight for the new Vertexpublic Vertex addVertex(java.lang.String label)
label
- the label for the new Vertexpublic Vertex addVertex()
public Vertex addVertex(int color, float weight)
color
- the color for the new Vertexweight
- the weight for the new Vertexpublic Vertex addVertex(float weight)
weight
- the weight for the new Vertexpublic void removeVertex(Vertex vertex)
vertex
- the Vertex to removepublic java.util.Iterator<Vertex> iterator()
iterator
in interface java.lang.Iterable
public java.util.Iterator<Vertex> vertexIterator()
public java.util.Iterator<Edge> edgeIterator()
public Vertex firstVertex()
public java.lang.Iterable<Vertex> vertices()
public java.lang.Iterable<Edge> edges()
public java.lang.String toString()
toString
in class java.lang.Object