edu.iastate.anthill.indus.datasource.type
Class Graph
java.lang.Object
edu.iastate.anthill.indus.datasource.type.DataType
edu.iastate.anthill.indus.datasource.type.Graph
- All Implemented Interfaces:
- Configable
- Direct Known Subclasses:
- DAG
- public class Graph
- extends DataType
- implements Configable
|
Field Summary |
(package private) java.util.Vector |
edges
|
(package private) java.util.Vector |
nodes
|
|
Constructor Summary |
Graph()
|
Graph(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
nodes
java.util.Vector nodes
edges
java.util.Vector edges
Graph
public Graph(java.lang.String name)
- Since:
- 1.0 2004-10-18
Graph
public Graph()
getNode
protected Node getNode(int i)
getEdge
protected Edge getEdge(int i)
addNode
private Node addNode(java.lang.String lbl)
addNode
void addNode(Node n)
findOrCreateNode
protected Node findOrCreateNode(java.lang.String lbl)
findEdge
protected Edge findEdge(java.lang.String from,
java.lang.String to)
addEdge
protected void addEdge(java.lang.String from,
java.lang.String to,
int len,
java.lang.String label)
- Add a edge. If node is not in node set yet, it will be added into the set
- Parameters:
from - Stringto - Stringlen - intlabel - String- Since:
- 1.0 2004-10-18
addEdge
protected void addEdge(java.lang.String from,
java.lang.String to)
renameEdge
public void renameEdge(Edge e,
java.lang.String newlabel)
deleteEdge
protected Edge deleteEdge(java.lang.String from,
java.lang.String to)
deleteEdge
protected Edge deleteEdge(Edge e)
findNode
protected Node findNode(java.lang.String lbl)
deleteNode
protected Node deleteNode(java.lang.String lbl)
deleteNode
protected Node deleteNode(Node n)
renameNode
public void renameNode(Node n,
java.lang.String newlabel)
fromXML
public void fromXML(java.lang.String datatypeinXML)
- Specified by:
fromXML in interface Configable
toXML
public java.lang.String toXML()
- Specified by:
toXML in interface Configable
getTaggedText
TaggedText getTaggedText()
- Since:
- 1.0 2004-10-18
getEditor
public javax.swing.JPanel getEditor()
- Specified by:
getEditor in class DataType
print
public java.lang.String print()
- Specified by:
print in class DataType
toString
public java.lang.String toString()
- Specified by:
toString in interface Configable- Specified by:
toString in class DataType
- Since:
- 1.0 2004-10-18
getInformation
public java.lang.String getInformation()
- Specified by:
getInformation in class DataType
readGraph
private void readGraph(java.lang.String edges,
java.lang.String center)
throws java.lang.NumberFormatException
- Throws:
java.lang.NumberFormatException
getRoots
public java.util.HashSet getRoots()
- return nodes with no parent
- Returns:
- HashSet
- Since:
- 1.0 2004-10-18
getParent
public java.util.HashSet getParent(Node n)
- Return parent nodes of a node
- Parameters:
n - Node
- Returns:
- HashSet
- Since:
- 2004-11-01
getChild
public java.util.HashSet getChild(Node n)
- Return child nodes of a node
- Parameters:
n - Node
- Returns:
- HashSet
- Since:
- 2004-11-01
getAllAncestor
public java.util.HashSet getAllAncestor(Node n)
getLeaves
public java.util.HashSet getLeaves()
- return nodes with no child
- Returns:
- HashSet
- Since:
- 1.0 2004-10-18
test
public static void test()
- Since:
- 1.0 2004-10-18