|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsem.graph.Graph
public class Graph
Graph structure.
Field Summary | |
---|---|
static Node |
ellip
Node for representing ellipes in the graph. |
static Node |
nil
Node for representing missing nodes. |
Constructor Summary | |
---|---|
Graph()
Create new graph. |
Method Summary | |
---|---|
Edge |
addEdge(Edge e)
Add a new edge to the graph. |
Edge |
addEdge(java.lang.String label,
Node head,
Node dep)
Create and add a new edge. |
Node |
addNode(Node n)
Add a new node to the graph. |
Node |
addNode(java.lang.String lemma,
java.lang.String pos)
Create and add a new node. |
Graph |
clone()
Create a new independent graph with identical nodes and edges. |
java.util.ArrayList<Edge> |
getEdges()
Get the list of edges in this graph. |
java.util.HashMap<java.lang.String,java.lang.String> |
getMetadata()
Get the HashMap containing all metadata. |
java.lang.String |
getMetadata(java.lang.String key)
Get metadata from the graph. |
java.util.ArrayList<Node> |
getNodes()
Get the list of nodes in this graph. |
boolean |
hasMetadata()
Check whether the graph has any metadata attached. |
void |
print()
Print the graph information into standard output. |
void |
putMetadata(java.lang.String key,
java.lang.String value)
Add metadata to the graph. |
java.lang.String |
toString()
Create a string representation of the graph. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Node ellip
public static Node nil
Constructor Detail |
---|
public Graph()
Method Detail |
---|
public java.util.ArrayList<Node> getNodes()
public java.util.ArrayList<Edge> getEdges()
public Node addNode(Node n)
n
- Node to be added.
public Node addNode(java.lang.String lemma, java.lang.String pos)
lemma
- Lemmapos
- POS
public Edge addEdge(Edge e)
e
- Edge.
public Edge addEdge(java.lang.String label, Node head, Node dep)
label
- Label of the edge.head
- Head node of the edge.dep
- Dependent node of the edge.
public void putMetadata(java.lang.String key, java.lang.String value)
key
- Keyvalue
- ValuegetMetadata
public java.lang.String getMetadata(java.lang.String key)
key
- Key
putMetadata
public java.util.HashMap<java.lang.String,java.lang.String> getMetadata()
public boolean hasMetadata()
public void print()
public java.lang.String toString()
toString
in class java.lang.Object
public Graph clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |