|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.graph.DenseGraph
public class DenseGraph
Class DenseGraph
Field Summary |
---|
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 | |
---|---|
DenseGraph(int size)
|
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 "in" 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 first vertex of the specified edge. |
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 outgoing edges of 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 second 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 outgoing 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. |
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 |
Constructor Detail |
---|
public DenseGraph(int size)
Method Detail |
---|
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()
Graph
getVerticesCount
in interface Graph
public int addVertex()
Graph
addVertex
in interface Graph
public void removeVertex(int vertex)
Graph
removeVertex
in interface Graph
vertex
- the vertex to removepublic int getEdgesCount()
Graph
getEdgesCount
in interface Graph
public int addEdge(int v1, int v2)
Graph
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)
Graph
getFirstVertex
in interface Graph
edge
- the edge.
public int getOtherVertex(int edge, int vertex)
Graph
getOtherVertex
in interface Graph
edge
- the edgevertex
- the vertex
public int getSecondVertex(int edge)
Graph
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 getEdge(int v1, int v2)
Graph
getEdge
in interface Graph
v1
- the first vertex.v2
- the second vertex.
public int findEdge(int v1, int v2)
Graph
findEdge
in interface Graph
v1
- the first vertex.v2
- the second vertex.
public int getOutDegree(int vertex)
Graph
getOutDegree
in interface Graph
vertex
- the vertex.
public int getDegree(int vertex)
Graph
getDegree
in interface Graph
vertex
- the vertex.
public RowIterator outEdgeIterator(int vertex)
Graph
outEdgeIterator
in interface Graph
vertex
- the vertex.
public int getInDegree(int vertex)
Graph
getInDegree
in interface Graph
vertex
- the vertex.
public RowIterator inEdgeIterator(int vertex)
Graph
inEdgeIterator
in interface Graph
vertex
- the vertex
public RowIterator edgeIterator(int vertex)
Graph
edgeIterator
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()
Graph
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 remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |