edu.stanford.nlp.trees.semgraph
Class SemanticGraphEdge

java.lang.Object
  extended by edu.stanford.nlp.trees.semgraph.SemanticGraphEdge
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SemanticGraphEdge>

public class SemanticGraphEdge
extends java.lang.Object
implements java.lang.Comparable<SemanticGraphEdge>, java.io.Serializable

Represents an edge in the dependency graph. Equal only if source, target, and relation are equal.

Author:
Christopher Cox, Teg Grenager
See Also:
SemanticGraph, Serialized Form

Field Summary
static boolean printOnlyRelation
           
 
Constructor Summary
SemanticGraphEdge(IndexedWord source, IndexedWord target, GrammaticalRelation relation, double weight)
           
SemanticGraphEdge(SemanticGraphEdge e)
           
 
Method Summary
 int compareTo(SemanticGraphEdge other)
          Compares SemanticGraphEdges.
 boolean equals(java.lang.Object o)
           
 IndexedWord getDependent()
           
 IndexedWord getGovernor()
           
 GrammaticalRelation getRelation()
           
 IndexedWord getSource()
           
 IndexedWord getTarget()
           
 double getWeight()
           
 int hashCode()
           
static java.util.Comparator<SemanticGraphEdge> orderByTargetComparator()
           
 void setRelation(GrammaticalRelation relation)
           
 void setWeight(double weight)
           
 java.lang.String toString()
           
 boolean typeEquals(SemanticGraphEdge e)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

printOnlyRelation

public static boolean printOnlyRelation
Constructor Detail

SemanticGraphEdge

public SemanticGraphEdge(IndexedWord source,
                         IndexedWord target,
                         GrammaticalRelation relation,
                         double weight)

SemanticGraphEdge

public SemanticGraphEdge(SemanticGraphEdge e)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRelation

public GrammaticalRelation getRelation()

setRelation

public void setRelation(GrammaticalRelation relation)

getSource

public IndexedWord getSource()

getGovernor

public IndexedWord getGovernor()

getTarget

public IndexedWord getTarget()

getDependent

public IndexedWord getDependent()

setWeight

public void setWeight(double weight)

getWeight

public double getWeight()

typeEquals

public boolean typeEquals(SemanticGraphEdge e)
Returns:
true if the edges are of the same relation type

orderByTargetComparator

public static java.util.Comparator<SemanticGraphEdge> orderByTargetComparator()

compareTo

public int compareTo(SemanticGraphEdge other)
Compares SemanticGraphEdges. Warning: compares on the sources, targets, and then the STRINGS of the relations.

Specified by:
compareTo in interface java.lang.Comparable<SemanticGraphEdge>
Parameters:
other - Edge to compare to
Returns:
Whether this is smaller, same, or larger

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Stanford NLP Group