Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.globalretailtech.pos.context
Class PosStack  view PosStack download PosStack.java

java.lang.Object
  extended bycom.globalretailtech.pos.context.PosStack
Direct Known Subclasses:
PosEventStack, PosStateStack

public class PosStack
extends java.lang.Object

Manages event stacks for a context, pending and processed. The pending stack is for events yet to be executed, processed are events that have been processed. In error conditions where the user wants to correct a dialog, the clear key will restore the processed to pending.


Field Summary
private  java.util.Stack pending
           
private  java.util.Stack processed
           
 
Constructor Summary
PosStack()
          Simple constructor creates a pending and processed stack.
 
Method Summary
protected  void clear()
          Clear both stacks.
 void clearPending()
          Clear the pending stack.
 void clearProcessed()
          Clear the processed stack.
 void dump()
          Useful method to dump the contents of both stacks to the debug Log.
protected  java.lang.Object peek()
          Look at the top of the stack.
protected  void pendingInsertElementAt(java.lang.Object o, int pos)
          Insert an object at a location in the stack.
protected  int pendingSize()
          Number of elements in the pending stack.
protected  java.lang.Object popPending()
          Pop the pending, push it on the processed and return it.
protected  int processedSize()
          Number of elements in the processed.
protected  void pushPending(java.lang.Object o)
          Push an object on the pending stack.
protected  void restore()
          Restore all of the processed to the pending.
protected  void set(java.lang.Object o)
          Clear the pending and push an object on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pending

private java.util.Stack pending

processed

private java.util.Stack processed
Constructor Detail

PosStack

public PosStack()
Simple constructor creates a pending and processed stack.

Method Detail

pendingSize

protected int pendingSize()
Number of elements in the pending stack.


processedSize

protected int processedSize()
Number of elements in the processed.


set

protected void set(java.lang.Object o)
Clear the pending and push an object on.


pendingInsertElementAt

protected void pendingInsertElementAt(java.lang.Object o,
                                      int pos)
Insert an object at a location in the stack.


peek

protected java.lang.Object peek()
Look at the top of the stack.


clear

protected void clear()
Clear both stacks.


popPending

protected java.lang.Object popPending()
Pop the pending, push it on the processed and return it.


pushPending

protected void pushPending(java.lang.Object o)
Push an object on the pending stack.


restore

protected void restore()
Restore all of the processed to the pending.


clearPending

public void clearPending()
Clear the pending stack.


clearProcessed

public void clearProcessed()
Clear the processed stack.


dump

public void dump()
Useful method to dump the contents of both stacks to the debug Log.