ubc.cs.JLog.Foundation
Class jDebugProvedGoalStack

java.lang.Object
  extended by ubc.cs.JLog.Foundation.jDebugProvedGoalStack
All Implemented Interfaces:
iDebugGoalStack, iGoalStack

public class jDebugProvedGoalStack
extends java.lang.Object
implements iDebugGoalStack


Nested Class Summary
 class jDebugProvedGoalStack.jDebugGoalItem
           
 
Field Summary
protected  java.util.Stack stack
           
 
Constructor Summary
jDebugProvedGoalStack()
           
 
Method Summary
 jGoal cut(jGoal item)
          Removes all goals above the specified item.
 boolean empty()
          Determines if the stack does not contain goals.
 jDebugProvedGoalStack.jDebugGoalItem getDebugItem(jGoal item)
           
 java.util.Vector getProvedDebugItems(jGoal next)
           
 java.util.Vector getStackCopy()
          Provides a vectorized duplicate of the goal stack.
 jGoal peek()
          Returns the top goal of the stack, without removing that goal.
 jDebugProvedGoalStack.jDebugGoalItem peekDebugItem()
           
 jGoal peekn(int n)
          Returns the nth goal on the stack, without removing that goal.
 jGoal pop()
          Returns and removes the top goal of the stack.
 jDebugProvedGoalStack.jDebugGoalItem popDebugItem()
           
 jGoal push(jGoal item)
          Places the provided goal item as the top element of the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

protected java.util.Stack stack
Constructor Detail

jDebugProvedGoalStack

public jDebugProvedGoalStack()
Method Detail

empty

public boolean empty()
Description copied from interface: iGoalStack
Determines if the stack does not contain goals.

Specified by:
empty in interface iGoalStack
Returns:
true if the stack is empty, false otherwise.

pop

public jGoal pop()
Description copied from interface: iGoalStack
Returns and removes the top goal of the stack. Do not pop an empty stack.

Specified by:
pop in interface iGoalStack
Returns:
the top jGoal of the stack.

peek

public jGoal peek()
Description copied from interface: iGoalStack
Returns the top goal of the stack, without removing that goal. Do not peek an empty stack.

Specified by:
peek in interface iGoalStack
Returns:
the top jGoal of the stack.

peekn

public jGoal peekn(int n)
Description copied from interface: iGoalStack
Returns the nth goal on the stack, without removing that goal. Do not peek an empty stack. 0 is the top element.

Specified by:
peekn in interface iGoalStack
Returns:
the nth jGoal of the stack.

push

public jGoal push(jGoal item)
Description copied from interface: iGoalStack
Places the provided goal item as the top element of the stack.

Specified by:
push in interface iGoalStack
Parameters:
item - the goal to add to the stack top.
Returns:
the top jGoal of the stack, which is the provided item.

cut

public jGoal cut(jGoal item)
Description copied from interface: iGoalStack
Removes all goals above the specified item. item becomes the top goal.

Specified by:
cut in interface iGoalStack
Parameters:
item - the goal to truncate the stack at. item becomes the stack top. item must be in this stack instance.
Returns:
the top jGoal of the stack, which is the provided item.

peekDebugItem

public jDebugProvedGoalStack.jDebugGoalItem peekDebugItem()

popDebugItem

public jDebugProvedGoalStack.jDebugGoalItem popDebugItem()

getDebugItem

public jDebugProvedGoalStack.jDebugGoalItem getDebugItem(jGoal item)

getProvedDebugItems

public java.util.Vector getProvedDebugItems(jGoal next)

getStackCopy

public java.util.Vector getStackCopy()
Description copied from interface: iDebugGoalStack
Provides a vectorized duplicate of the goal stack.

Specified by:
getStackCopy in interface iDebugGoalStack
Returns:
Vector of jGoals where the zero index element in the vector is the stack bottom, and the element with the largest index is the stack top.