org.maltparser.core.syntaxgraph.edge
Class GraphEdge
java.lang.Object
java.util.Observable
org.maltparser.core.syntaxgraph.GraphElement
org.maltparser.core.syntaxgraph.edge.GraphEdge
- All Implemented Interfaces:
- Comparable<GraphEdge>, Edge, Element
- Direct Known Subclasses:
- WeightedEdge
public class GraphEdge
- extends GraphElement
- implements Edge, Comparable<GraphEdge>
- Author:
- Johan Hall
Methods inherited from class org.maltparser.core.syntaxgraph.GraphElement |
addLabel, addLabel, addLabel, compareTo, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph |
Methods inherited from interface org.maltparser.core.syntaxgraph.Element |
addLabel, addLabel, addLabel, getBelongsToGraph, getLabelCode, getLabelSet, getLabelSymbol, getLabelTypes, hasLabel, isLabeled, nLabels, removeLabel, removeLabels, setBelongsToGraph |
GraphEdge
public GraphEdge()
GraphEdge
public GraphEdge(Node source,
Node target,
int type)
throws MaltChainedException
- Throws:
MaltChainedException
setEdge
public void setEdge(Node source,
Node target,
int type)
throws MaltChainedException
- Sets the edge with a source node, a target node and a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE
or SECONDARY_EDGE).
- Specified by:
setEdge
in interface Edge
- Parameters:
source
- a source nodetarget
- a target nodetype
- a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE)
- Throws:
MaltChainedException
clear
public void clear()
throws MaltChainedException
- Description copied from class:
GraphElement
- Resets the graph element.
- Specified by:
clear
in interface Element
- Overrides:
clear
in class GraphElement
- Throws:
MaltChainedException
getSource
public Node getSource()
- Returns the source node of the edge.
- Specified by:
getSource
in interface Edge
- Returns:
- the source node of the edge.
getTarget
public Node getTarget()
- Returns the target node of the edge.
- Specified by:
getTarget
in interface Edge
- Returns:
- the target node of the edge.
getType
public int getType()
- Returns the edge type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE).
- Specified by:
getType
in interface Edge
- Returns:
- the edge type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE).
compareTo
public int compareTo(GraphEdge that)
- Specified by:
compareTo
in interface Comparable<GraphEdge>
equals
public boolean equals(Object obj)
- Overrides:
equals
in class GraphElement
hashCode
public int hashCode()
- Overrides:
hashCode
in class GraphElement
toString
public String toString()
- Overrides:
toString
in class GraphElement
Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.