The Gravy Framework

Class DequeModel

Object
   |
   +--OObject
         |
         +--Observer
               |
               +--Model
                     |
                     +--ListModel
                           |
                           +--DequeModel
Direct Known Subclasses:
UndoRedoModel

class DequeModel
extends ListModel


This class encapsulates a data model for Stacks and Queues. The "stack" is built within a dequeue such that up/down do not change the queue itself.
Author: Bruce Wallace (PolyGlotInc.com)
Defined in mvc.js

Version: 1.0


Constructor Summary
DequeModel ()
           
 
Method Summary
 void _cutback()
           pseudo-Stack API: throw away items above top of pseudo-stack
 Object _down()
           pseudo-Stack API: non-destructive pop
 void _reset( )
           clear the queue and reset the pseudo-stack but dont publish
 Object _up()
           pseudo-Stack API: non-destructive push/get
 Object addFirst(o)
           DEQUE API: add given object to back of the line
 Object addLast(o)
           DEQUE API: add given object to front of the line
 Object delFirst( )
           DEQUE API: remove object from back of the line
 Object delLast( )
           DEQUE API: remove object from front of the line
 Object dequeue( )
           QUEUE API: remove object from front of the line
 Object downIndex()
           pseudo-Stack API: return index of next down iff we can go down
 Object enqueue(o)
           QUEUE API: add given object to back of the line
 void konstructor( <String> optName )
          
 Object pop( )
           STACK API: remove given object from front of the line aka top of the stack
 Object push(o)
           STACK API: push given object to front of the line aka top of the stack
 Object top(offset)
           pseudo-Stack API: return the top of the pseudo-stack
 Object upIndex()
           pseudo-Stack API: return index of next up iff we can go up
 
Methods inherited from class ListModel
dump, _pop, _push, getCount, getItem, getItemStr, addItem, reset, iterate, addBefore
   
Methods inherited from class Model
dumpSubscribers, toString, dirty, clean, neverChanged, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, addObserver, delObserver, notifyObservers
   
Methods inherited from class Observer
update, subscribe
 

Constructor Detail

DequeModel

DequeModel()

Method Detail

_cutback

void _cutback()

_down

Object _down()

_reset

void _reset( )

_up

Object _up()

addFirst

Object addFirst(o)

addLast

Object addLast(o)

delFirst

Object delFirst( )

delLast

Object delLast( )

dequeue

Object dequeue( )

downIndex

Object downIndex()

enqueue

Object enqueue(o)

konstructor

void konstructor( <String> optName )

pop

Object pop( )

push

Object push(o)

top

Object top(offset)

upIndex

Object upIndex()

The Gravy Framework

Documentation generated by JSDoc on Fri Mar 17 06:40:21 2006