GraphElement (MaltParser 1.4.1)
Date: 2010-07-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.maltparser.core.syntaxgraph
Class GraphElement

    java.lang.Object
      java.util.Observable
          org.maltparser.core.syntaxgraph.GraphElement

All Implemented Interfaces:
  Element

Direct Known Subclasses:
  GraphEdge, GraphNode

    public abstract class GraphElement

extends Observable
implements Element

Author:
  Johan Hall

Constructor Summary
`GraphElement()`

Method Summary
`void` | `addLabel(LabelSet labels)` Adds the labels of the label set to the label set of the graph element.
`void` | `addLabel(SymbolTable table, int code)` Adds a label (an integer value) to the symbol table and to the graph element.
`void` | `addLabel(SymbolTable table, String symbol)` Adds a label (a string value) to the symbol table and to the graph element.
`void` | `clear()` Resets the graph element.
`int` | `compareTo(GraphElement o)`
`boolean` | `equals(Object obj)`
`SyntaxGraph` | `getBelongsToGraph()` Returns the graph (structure) in which the graph element belongs to.
`int` | `getLabelCode(SymbolTable table)` Returns the label code (an integer representation) of the symbol table if it exists, otherwise an exception is thrown.
`LabelSet` | `getLabelSet()` Returns the label set.
`String` | `getLabelSymbol(SymbolTable table)` Returns the label symbol(a string representation) of the symbol table if it exists, otherwise an exception is thrown.
`Set<SymbolTable>` | `getLabelTypes()` Returns a set of symbol tables (labeling functions or label types) that labels the graph element.
`int` | `hashCode()`
`boolean` | `hasLabel(SymbolTable table)` Returns true if the graph element has a label for the symbol table, otherwise false.
`boolean` | `isLabeled()` Returns true if the graph element has one or more labels, otherwise false.
`int` | `nLabels()` Returns the number of labels of the graph element.
`void` | `removeLabel(SymbolTable table)`
`void` | `removeLabels()`
`void` | `setBelongsToGraph(SyntaxGraph belongsToGraph)` Sets the graph (structure) in which the graph element belongs to.
`String` | `toString()`

Methods inherited from class java.util.Observable
`addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### GraphElement

    public GraphElement()

Method Detail

### addLabel

    public void addLabel(SymbolTable table,
                         String symbol)
                  throws MaltChainedException

  Adds a label (a string value) to the symbol table and to the graph element.

  Specified by:
    `addLabel` in interface `Element`
  Parameters:
    `table` - the symbol table
    `symbol` - a label symbol
  Throws:
    `MaltChainedException`

### addLabel

    public void addLabel(SymbolTable table,
                         int code)
                  throws MaltChainedException

  Adds a label (an integer value) to the symbol table and to the graph element.

  Specified by:
    `addLabel` in interface `Element`
  Parameters:
    `table` - the symbol table
    `code` - a label code
  Throws:
    `MaltChainedException`

### addLabel

    public void addLabel(LabelSet labels)
                  throws MaltChainedException

  Adds the labels of the label set to the label set of the graph element.

  Specified by:
    `addLabel` in interface `Element`
  Parameters:
    `labels` - a label set.
  Throws:
    `MaltChainedException`

### hasLabel

    public boolean hasLabel(SymbolTable table)
                     throws MaltChainedException

  Returns true if the graph element has a label for the symbol table, otherwise false.

  Specified by:
    `hasLabel` in interface `Element`
  Parameters:
    `table` - the symbol table
  Returns:
    true if the graph element has a label for the symbol table, otherwise false.
  Throws:
    `MaltChainedException`

### getLabelSymbol

    public String getLabelSymbol(SymbolTable table)
                          throws MaltChainedException

  Returns the label symbol(a string representation) of the symbol table if it exists, otherwise an exception is thrown.

  Specified by:
    `getLabelSymbol` in interface `Element`
  Parameters:
    `table` - the symbol table
  Returns:
    the label (a string representation) of the symbol table if it exists.
  Throws:
    `MaltChainedException`

### getLabelCode

    public int getLabelCode(SymbolTable table)
                     throws MaltChainedException

  Returns the label code (an integer representation) of the symbol table if it exists, otherwise an exception is thrown.

  Specified by:
    `getLabelCode` in interface `Element`
  Parameters:
    `table` - the symbol table
  Returns:
    the label code (an integer representation) of the symbol table if it exists
  Throws:
    `MaltChainedException`

### isLabeled

    public boolean isLabeled()

  Returns true if the graph element has one or more labels, otherwise false.

  Specified by:
    `isLabeled` in interface `Element`
  Returns:
    true if the graph element has one or more labels, otherwise false.

### nLabels

    public int nLabels()

  Returns the number of labels of the graph element.

  Specified by:
    `nLabels` in interface `Element`
  Returns:
    the number of labels of the graph element.

### getLabelTypes

    public Set<SymbolTable> getLabelTypes()

  Returns a set of symbol tables (labeling functions or label types) that labels the graph element.

  Specified by:
    `getLabelTypes` in interface `Element`
  Returns:
    a set of symbol tables (labeling functions or label types)

### getLabelSet

    public LabelSet getLabelSet()

  Returns the label set.

  Specified by:
    `getLabelSet` in interface `Element`
  Returns:
    the label set.

### removeLabel

    public void removeLabel(SymbolTable table)
                     throws MaltChainedException

  Specified by:
    `removeLabel` in interface `Element`
  Throws:
    `MaltChainedException`

### removeLabels

    public void removeLabels()
                      throws MaltChainedException

  Specified by:
    `removeLabels` in interface `Element`
  Throws:
    `MaltChainedException`

### getBelongsToGraph

    public SyntaxGraph getBelongsToGraph()

  Returns the graph (structure) in which the graph element belongs to.

  Specified by:
    `getBelongsToGraph` in interface `Element`
  Returns:
    the graph (structure) in which the graph element belongs to.

### setBelongsToGraph

    public void setBelongsToGraph(SyntaxGraph belongsToGraph)

  Sets the graph (structure) in which the graph element belongs to.

  Specified by:
    `setBelongsToGraph` in interface `Element`
  Parameters:
    `belongsToGraph` - a graph (structure).

### clear

    public void clear()
               throws MaltChainedException

  Resets the graph element.

  Specified by:
    `clear` in interface `Element`
  Throws:
    `MaltChainedException`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### compareTo

    public int compareTo(GraphElement o)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.