to.etc.domui.component.tbl
Class SimpleKeyModel<T,P>

java.lang.Object
  extended by to.etc.domui.component.tbl.TableModelBase<T>
      extended by to.etc.domui.component.tbl.SimpleKeyModel<T,P>
All Implemented Interfaces:
ITableModel<T>

public abstract class SimpleKeyModel<T,P>
extends TableModelBase<T>
implements ITableModel<T>

Model for key-value list data.

Author:
Vladimir Mijic Created on 7 Feb 2011

Field Summary
 
Fields inherited from interface to.etc.domui.component.tbl.ITableModel
DEFAULT_MAX_SIZE
 
Constructor Summary
SimpleKeyModel()
           
SimpleKeyModel(java.util.List<P> in)
           
 
Method Summary
 T getItem(int ix)
           
abstract  T getItemForKey(P key)
           
 java.util.List<T> getItems(int start, int end)
           
 java.util.List<P> getKeyList()
           
 int getRows()
          This must return the total #of rows in this table.
 
Methods inherited from class to.etc.domui.component.tbl.TableModelBase
addChangeListener, fireAdded, fireDeleted, fireModelChanged, fireModified, getListeners, refresh, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface to.etc.domui.component.tbl.ITableModel
addChangeListener, refresh, removeChangeListener
 

Constructor Detail

SimpleKeyModel

public SimpleKeyModel()

SimpleKeyModel

public SimpleKeyModel(java.util.List<P> in)
Method Detail

getKeyList

public java.util.List<P> getKeyList()
                             throws java.lang.Exception
Throws:
java.lang.Exception

getItemForKey

public abstract T getItemForKey(P key)
                         throws java.lang.Exception
Throws:
java.lang.Exception

getItem

public T getItem(int ix)
          throws java.lang.Exception
Specified by:
getItem in class TableModelBase<T>
Throws:
java.lang.Exception

getItems

public java.util.List<T> getItems(int start,
                                  int end)
                           throws java.lang.Exception
Specified by:
getItems in interface ITableModel<T>
Throws:
java.lang.Exception

getRows

public int getRows()
            throws java.lang.Exception
Description copied from interface: ITableModel
This must return the total #of rows in this table.

Specified by:
getRows in interface ITableModel<T>
Returns:
Throws:
java.lang.Exception