Fido Alpha 3.2

fido.grammar
Class StackElement

java.lang.Object
  |
  +--fido.grammar.StackElement
All Implemented Interfaces:
java.lang.Cloneable

public class StackElement
extends java.lang.Object
implements java.lang.Cloneable

Represents all of the grammar expressions for a word. If the word in the input has any open links, Grammar creates a new StackElement to be placed on the GrammarStack.

See Also:
GrammarStack

Constructor Summary
StackElement(WordSense sense)
          Creates a new StackElement.
 
Method Summary
 void addOpenExpression(NodeExpression exp)
          Add an open expression.
 boolean allExpressionsUsed()
          Tests if: There are no more expressions The only expression is a multi-node and it has been used
 StackElement cloneStackElement()
          Creates a deep copy of this element.
 java.util.Iterator expressionIterator()
          Returns an iterator over the expressions in this element.
 NodeExpression getExpression()
          Get the first element of the open expression queue.
 WordSense getNodeWordSense()
          Returns the WordSense associated with this element.
 boolean hasMoreExpressions()
          Tests for an open expressions held by this element.
 void removeExpression()
          Removes the first element of the open expression queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackElement

public StackElement(WordSense sense)
Creates a new StackElement. Each element contains one to many open Expresssions and a WordSense.

Parameters:
sense - WordSense for the element.
Method Detail

addOpenExpression

public void addOpenExpression(NodeExpression exp)
Add an open expression.

Parameters:
exp - Grammar expression for the element.

getExpression

public NodeExpression getExpression()
Get the first element of the open expression queue.

Returns:
First expression in queue

expressionIterator

public java.util.Iterator expressionIterator()
Returns an iterator over the expressions in this element.

Returns:
Iterator for the expressions

hasMoreExpressions

public boolean hasMoreExpressions()
Tests for an open expressions held by this element.

Returns:
True if any open expressions exist. False otherwise.

allExpressionsUsed

public boolean allExpressionsUsed()
Tests if:

removeExpression

public void removeExpression()
Removes the first element of the open expression queue.


getNodeWordSense

public WordSense getNodeWordSense()
Returns the WordSense associated with this element.

Returns:
The WordSense associated with this element.

cloneStackElement

public StackElement cloneStackElement()
Creates a deep copy of this element.

Returns:
A new copy of this element.

Fido Alpha 3.2