001 package org.maltparser.core.syntaxgraph.edge;
002
003 import org.maltparser.core.exception.MaltChainedException;
004 import org.maltparser.core.syntaxgraph.Element;
005 import org.maltparser.core.syntaxgraph.node.Node;
006 /**
007 *
008 *
009 * @author Johan Hall
010 */
011 public interface Edge extends Element {
012 public static final int DEPENDENCY_EDGE = 1;
013 public static final int PHRASE_STRUCTURE_EDGE = 2;
014 public static final int SECONDARY_EDGE = 3;
015
016 /**
017 * Sets the edge with a source node, a target node and a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE
018 * or SECONDARY_EDGE).
019 *
020 * @param source a source node
021 * @param target a target node
022 * @param type a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE)
023 * @throws MaltChainedException
024 */
025 public void setEdge(Node source, Node target, int type) throws MaltChainedException;
026 /**
027 * Returns the source node of the edge.
028 *
029 * @return the source node of the edge.
030 */
031 public Node getSource();
032 /**
033 * Returns the target node of the edge.
034 *
035 * @return the target node of the edge.
036 */
037 public Node getTarget();
038 /**
039 * Returns the edge type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE).
040 *
041 * @return the edge type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE or SECONDARY_EDGE).
042 */
043 public int getType();
044 }