Overview | File | Class | Tree | Index | Help
| The Gravey 2.0 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class MVCListModel

    Object
       |
       +--GrvObject
             |
             +--MVCObserver
                   |
                   +--MVCModel
                         |
                         +--MVCListModel

Direct Known Subclasses:
  MVCDequeModel, EDOListModel

class MVCListModel
extends MVCModel

This class encapsulates a data model for a List of objects. This class implements the MVCCollection interface.
Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
Defined in grvMVC.js

Constructor Summary
`MVCListModel ()`

Method Summary
`Object` | `_del(i)` delete given index from list
`Object` | `_pop( )` pop top item off list but dont publish
`int` | `_push(o)` push item onto list but dont publish
`Object` | `_reset( )` clear list and update timestamp but dont publish
`void` | `addBefore(i,o)` add the given object into the list just before the given zero-based-index
`int` | `addItem(o)` push given item onto list and publish
`MVCListModel` | `clone()` return a (deep) clone of "this" object.
`Object` | `delItem(i)` delete given index from list and publish
`String` | `dump()` debug method to return this list as a string
`int` | `getCount( )` return count of items in list
`Object` | `getItem(i)` return item in list with given index
`String` | `getItemStr(i)` return item in list with given index as formatted string
`Object` | `getMemento()` return a memento of the current state of "this"
`int` | `hash()` provide a "unique" number based on the state of this list NOTE: the quality of this hash code depends on the quality of the hash code provided by each list item.
`void` | `iterate(<Function> f)` iterate thru items in list calling specified function
`void` | `konstructor( <String> optName )`
`Object` | `reset( )` clear list and publish
`void` | `setMemento(<Object> m)` update "this" based on the given memento

Methods inherited from class MVCModel
`dumpSubscribers, toString, dirty, clean, neverChanged, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, reloaded, addObserver, delObserver, notifyObservers`

Methods inherited from class MVCObserver
`update, subscribe`

Methods inherited from class GrvObject
`souper, souper_, isInstanceOf`

Constructor Detail

### MVCListModel

    MVCListModel()

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)

Method Detail

### _del

    Object _del(i)

delete given index from list

Returns:

deleted item

### _pop

    Object _pop( )

pop top item off list but dont publish

Returns:

item

### _push

    int _push(o)

push item onto list but dont publish

Returns:

index

### _reset

    Object _reset( )

clear list and update timestamp but dont publish

### addBefore

    void addBefore(i,o)

add the given object into the list just before the given zero-based-index

### addItem

    int addItem(o)

push given item onto list and publish

Returns:

index

### clone

    MVCListModel clone()

return a (deep) clone of "this" object.

### delItem

    Object delItem(i)

delete given index from list and publish

Returns:

deleted item

### dump

    String dump()

debug method to return this list as a string

### getCount

    int getCount( )

return count of items in list

### getItem

    Object getItem(i)

return item in list with given index

### getItemStr

    String getItemStr(i)

return item in list with given index as formatted string

### getMemento

    Object getMemento()

return a memento of the current state of "this"

### hash

    int hash()

provide a "unique" number based on the state of this list NOTE: the quality of this hash code depends on the quality of the hash code provided by each list item.

Deprecated

### iterate

    void iterate(<Function> f)

iterate thru items in list calling specified function

Parameters:

`f` - function that takes index and object as params and returns true if the iteration should be stopped before all items in list are processed.

### konstructor

    void konstructor( <String> optName )

Parameters:

`optName` - optional name of this instance

### reset

    Object reset( )

clear list and publish

### setMemento

    void setMemento(<Object> m)

update "this" based on the given memento

Parameters:

`m` - the memento

Overview | File | Class | Tree | Index | Help
| The Gravey 2.0 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Sun Feb 11 13:28:59 2007