pl.edu.pjwstk.yaod.yaql.engine
Class QueryResultStack

java.lang.Object
  |
  +--pl.edu.pjwstk.yaod.yaql.engine.QueryResultStack

public class QueryResultStack
extends java.lang.Object

The QueryResultStack class represents the query result stack, which is responsible for holding all possible results which can be yielded during evaluation.

Author:
Jakub Trzetrzelewski, jakub_trzetrzelewski@yahoo.com
See Also:
QueryResult

Constructor Summary
QueryResultStack()
          Creates a new query result stack.
 
Method Summary
 boolean empty()
          Tests whether or not the stack is empty.
 QueryResult getElementAt(int i)
          Returns (without removal) the i-th element from the query result stack.
 QueryResult getFirstElement()
          Returns (without removal) the first element from the query result stack.
 QueryResult getLastElement()
          Returns (without removal) the last element from the query result stack.
 int getSize()
          Returns the number of elements in the query result stack.
 QueryResult pop()
          Returns (and removes) the last element from the query result stack.
 void push(QueryResult qr)
          Puts new element onto query result stack.
 void show()
          Shows all the elements of query result stack.
 QueryResult top()
          Returns (without removal) the last element from the query result stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultStack

public QueryResultStack()
Creates a new query result stack.
Method Detail

empty

public boolean empty()
Tests whether or not the stack is empty.
Returns:
true if stack is empty, false otherwise.

push

public void push(QueryResult qr)
Puts new element onto query result stack.
See Also:
QueryResult

pop

public QueryResult pop()
                throws EmptyStackException
Returns (and removes) the last element from the query result stack.
Returns:
the last section of query result stack.
Throws:
EmptyStackException - if stack is empty.
See Also:
QueryResult

top

public QueryResult top()
                throws EmptyStackException
Returns (without removal) the last element from the query result stack.
Returns:
the last section of query result stack.
Throws:
EmptyStackException - if stack is empty.
See Also:
QueryResult

getSize

public int getSize()
Returns the number of elements in the query result stack.
Returns:
the number of elements in the query result stack.

getElementAt

public QueryResult getElementAt(int i)
Returns (without removal) the i-th element from the query result stack.
Parameters:
i - the index of element to be returned.
Returns:
the i-th element of query result stack.
See Also:
QueryResult

getFirstElement

public QueryResult getFirstElement()
Returns (without removal) the first element from the query result stack.
Returns:
the first section of query result stack.
See Also:
QueryResult

getLastElement

public QueryResult getLastElement()
Returns (without removal) the last element from the query result stack.
Returns:
the last section of query result stack.
See Also:
QueryResult

show

public void show()
Shows all the elements of query result stack.