|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.graph.DefaultGraph
public class DefaultGraph
Field Summary | |
---|---|
static String |
FIRSTEDGE_COLUMN
Name of the column containing the index of the first outgoing edge. |
static String |
FIRSTINEDGE_COLUMN
Name of the column containing the first incoming edge. |
static String |
GRAPH_METADATA
The Metadata key of the Graph using the Table |
static String |
INVERTEX_COLUMN
Name of the column containing the first vertex in the edge table. |
static String |
LASTEDGE_COLUMN
Name of the column containing the index of the last outgoing edge. |
static String |
LASTINEDGE_COLUMN
Name of the column containing last incoming edge. |
static String |
NEXTEDGE_COLUMN
Name of the column containing the next ougoing edge in the edge table. |
static String |
NEXTINEDGE_COLUMN
Name of the column containing the next incoming edge in the edge table. |
static String |
OUTVERTEX_COLUMN
Name of the column containing the second vertex in the edge table. |
static String |
PREVEDGE_COLUMN
Name of the column containing the previous outgoing edge in the edge table. |
static String |
PREVINEDGE_COLUMN
Name of the column containing the previous incoming edge in the edge table. |
Fields inherited from interface infovis.Graph |
---|
GRAPH_TYPE, GRAPH_TYPE_DIRECTED, GRAPH_TYPE_UNDIRECTED, NIL |
Fields inherited from interface infovis.metadata.Constants |
---|
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
Constructor Summary | |
---|---|
DefaultGraph()
Constructor for Graph. |
Method Summary | |
---|---|
int |
addEdge(int v1,
int v2)
Adds a new edge between two vertices. |
void |
addGraphChangedListener(GraphChangedListener l)
Attaches a GraphChangedListener to the graph. |
int |
addVertex()
Adds a new vertex to the graph. |
void |
clear()
Clears the Graph. |
RowIterator |
edgeIterator()
Returns an iterator over the edges of the graph. |
RowIterator |
edgeIterator(int vertex)
Returns an iterator over all the edges (incoming and outgoing) of a specified vertex. |
int |
findEdge(int v1,
int v2)
Returns an edge between two specified vertices. |
MutableAttributeSet |
getClientProperty()
Returns the clientPropery. |
int |
getDegree(int vertex)
Returns the degree of the vertex, which is inDegree + outDegree. |
int |
getEdge(int v1,
int v2)
Returns an edge between two specified vertices. |
int |
getEdgesCount()
Returns the number of edges in the graph. |
DynamicTable |
getEdgeTable()
Returns the edgeTable. |
int |
getFirstVertex(int edge)
Returns the "in" vertex of an edge. |
static Graph |
getGraph(Table table)
|
int |
getInDegree(int vertex)
Returns the in degree of the vertex, which is simply the number of incoming edges at the vertex. |
int |
getInEdgeAt(int vertex,
int index)
Returns the incoming edge of a specified vertrex at a specified index. |
MutableAttributeSet |
getMetadata()
Returns the metadata. |
String |
getName()
Returns the Graph name. |
int |
getOtherVertex(int edge,
int vertex)
Given a specified edge and a vertex on one side of this edge, returns the vertex on the other side. |
int |
getOutDegree(int vertex)
Returns the out degree of the vertex, which is simply the number of edges starting from the vertex. |
int |
getOutEdgeAt(int vertex,
int index)
Returns the outgoing edge of a specified vertex at a specified index. |
int |
getSecondVertex(int edge)
Returns the "out" vertex of an edge. |
DynamicTable |
getVertexTable()
Returns the vertex Table. |
int |
getVerticesCount()
Returns the number of vertices in the graph |
RowIterator |
inEdgeIterator(int vertex)
Returns an iterator over the incoming edges of specified vertex. |
boolean |
isDirected()
Returns true if the graph is directed. |
RowIterator |
outEdgeIterator(int vertex)
Returns an iterator over the edges of a specified vertex. |
void |
removeEdge(int edge)
Removes the specified edge. |
void |
removeGraphChangedListener(GraphChangedListener l)
Removes a GraphChangedListener from the graph. |
void |
removeVertex(int vertex)
Removes the specified vertex from the graph. |
void |
setDirected(boolean directed)
Sets the graph to directed or undirected. |
void |
setName(String name)
Sets the Graph name. |
void |
tableChanged(TableModelEvent e)
|
RowIterator |
vertexIterator()
Returns an iterator over the vertices of the graph. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FIRSTEDGE_COLUMN
public static final String LASTEDGE_COLUMN
public static final String INVERTEX_COLUMN
public static final String OUTVERTEX_COLUMN
public static final String NEXTEDGE_COLUMN
public static final String PREVEDGE_COLUMN
public static final String GRAPH_METADATA
public static final String FIRSTINEDGE_COLUMN
public static final String LASTINEDGE_COLUMN
public static final String NEXTINEDGE_COLUMN
public static final String PREVINEDGE_COLUMN
Constructor Detail |
---|
public DefaultGraph()
Method Detail |
---|
public static Graph getGraph(Table table)
public MutableAttributeSet getClientProperty()
getClientProperty
in interface Metadata
public MutableAttributeSet getMetadata()
getMetadata
in interface Metadata
public String getName()
Graph
getName
in interface Graph
public void setName(String name)
Graph
setName
in interface Graph
name
- The Graph name to setpublic void clear()
Graph
After this method, the graph tables are almost in the same state as if it had been created afresh except it contains the same columns as before but they are all cleared.
clear
in interface Graph
public boolean isDirected()
Graph
isDirected
in interface Graph
public void setDirected(boolean directed)
Graph
setDirected
in interface Graph
directed
- boolean specifying whether the graph is directed or not.public int getVerticesCount()
getVerticesCount
in interface Graph
public int addVertex()
addVertex
in interface Graph
public void removeVertex(int vertex)
Graph
removeVertex
in interface Graph
vertex
- the vertex to removepublic int getEdgesCount()
getEdgesCount
in interface Graph
public int addEdge(int v1, int v2)
addEdge
in interface Graph
v1
- the first vertex.v2
- the second vertex.
public void removeEdge(int edge)
Graph
removeEdge
in interface Graph
edge
- the edge to removepublic int getFirstVertex(int edge)
getFirstVertex
in interface Graph
edge
- the edge.
public int getSecondVertex(int edge)
getSecondVertex
in interface Graph
edge
- the edge.
public int getOutEdgeAt(int vertex, int index)
Graph
getOutEdgeAt
in interface Graph
vertex
- the in vertex of the requested edgeindex
- the index of the edge in the edge list of the vertex
public int getInEdgeAt(int vertex, int index)
Graph
getInEdgeAt
in interface Graph
vertex
- the out vertex of the requested edgeindex
- the index of the edge in the edge list of the vertex
public int getOtherVertex(int edge, int vertex)
Graph
getOtherVertex
in interface Graph
edge
- the edgevertex
- the vertex
public int getEdge(int v1, int v2)
getEdge
in interface Graph
v1
- the first vertex.v2
- the second vertex.
public int findEdge(int v1, int v2)
findEdge
in interface Graph
v1
- the first vertex.v2
- the second vertex.
public int getOutDegree(int vertex)
getOutDegree
in interface Graph
vertex
- the vertex.
public int getInDegree(int vertex)
Graph
getInDegree
in interface Graph
vertex
- the vertex.
public int getDegree(int vertex)
Graph
getDegree
in interface Graph
vertex
- the vertex.
public RowIterator edgeIterator(int vertex)
Graph
edgeIterator
in interface Graph
vertex
- the vertex.
public RowIterator outEdgeIterator(int vertex)
outEdgeIterator
in interface Graph
vertex
- the vertex.
public RowIterator inEdgeIterator(int vertex)
Graph
inEdgeIterator
in interface Graph
vertex
- the vertex
public RowIterator vertexIterator()
Graph
vertexIterator
in interface Graph
public RowIterator edgeIterator()
Graph
edgeIterator
in interface Graph
public DynamicTable getEdgeTable()
getEdgeTable
in interface Graph
public DynamicTable getVertexTable()
Graph
getVertexTable
in interface Graph
public void addGraphChangedListener(GraphChangedListener l)
Graph
addGraphChangedListener
in interface Graph
l
- the GraphChangedListener to notify when the graph structure changes.public void removeGraphChangedListener(GraphChangedListener l)
Graph
removeGraphChangedListener
in interface Graph
l
- the GraphChangedListener to removepublic void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |