|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectubc.cs.JLog.Foundation.jGoalStack
public class jGoalStack
jGoalStack
is the default goal stack implementation.
It is efficient, with a super-efficient cut operation.
The design purpose of this class is purely efficiency.
Field Summary | |
---|---|
protected jGoal |
head
|
Constructor Summary | |
---|---|
jGoalStack()
|
Method Summary | |
---|---|
jGoal |
cut(jGoal item)
Removes all goals above the specified item . |
boolean |
empty()
Determines if the stack does not contain goals. |
jGoal |
peek()
Returns the top goal of the stack, without removing that goal. |
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. |
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 |
---|
protected jGoal head
Constructor Detail |
---|
public jGoalStack()
Method Detail |
---|
public boolean empty()
iGoalStack
empty
in interface iGoalStack
true
if the stack is empty,
false
otherwise.public jGoal pop()
iGoalStack
pop
in interface iGoalStack
jGoal
of the stack.public jGoal peek()
iGoalStack
peek
in interface iGoalStack
jGoal
of the stack.public jGoal peekn(int n)
iGoalStack
peekn
in interface iGoalStack
jGoal
of the stack.public jGoal push(jGoal item)
iGoalStack
item
as the top element of the stack.
push
in interface iGoalStack
item
- the goal to add to the stack top.
jGoal
of the stack, which is the
provided item
.public jGoal cut(jGoal item)
iGoalStack
item
. item
becomes the top goal.
cut
in interface iGoalStack
item
- the goal to truncate the stack at. item
becomes
the stack top. item
must be in this stack
instance.
jGoal
of the stack, which is the
provided item
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |