public abstract class TableKeyModelBase<K,T> extends TableModelBase<T> implements ITableModel<T>, IModifyableTableModel<K>
getItems(List).DEFAULT_MAX_SIZE, IN_MEMORY_FILTER_OR_SORT_MAX_SIZE| Constructor and Description |
|---|
TableKeyModelBase(Collection<K> keycoll)
Create an unsortable model using the specified collection as source.
|
TableKeyModelBase(Collection<K> keycoll,
Comparator<K> comp)
Create a model where the keys are sorted using the specified comparator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
K key)
Add a new key to show @ the specified location in the list(!).
|
void |
add(K row)
Add a new key to the model.
|
K |
delete(int index)
Delete the specified index from the backing list.
|
boolean |
delete(K val)
Delete the specified key from the list and the backing set.
|
protected T |
getItem(int index)
Internal: get a T for the specified index, to properly send events.
|
List<T> |
getItems(int start,
int end) |
protected abstract List<T> |
getItems(List<K> keys)
This method must return, for every K in the keys parameter, the proper T that belongs to that K, in the same
order as the K's specified.
|
int |
getRows()
This must return the total #of rows in this table.
|
void |
modified(int index)
Send a "modified" message for the specified index.
|
void |
modified(K key)
Send a modified event for the specified key, if found.
|
void |
move(int to,
int from)
Convenience method to move a key from index from to index to.
|
addChangeListener, fireAdded, fireDeleted, fireModelChanged, fireModified, getListeners, refresh, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, refresh, removeChangeListenerpublic TableKeyModelBase(@Nonnull Collection<K> keycoll)
IModifyableTableModel methods is called.keycoll - public TableKeyModelBase(@Nonnull Collection<K> keycoll, @Nonnull Comparator<K> comp)
keycoll - comp - @Nonnull protected abstract List<T> getItems(List<K> keys) throws Exception
keys - Exception@Nonnull public List<T> getItems(int start, int end) throws Exception
getItems in interface ITableModel<T>Exception@Nullable protected final T getItem(int index) throws Exception
getItem in class TableModelBase<T>ExceptionTableModelBase.getItem(int)public int getRows()
throws Exception
ITableModelgetRows in interface ITableModel<T>ExceptionITableModel.getRows()public void add(int index,
@Nonnull
K key)
throws Exception
add in interface IModifyableTableModel<K>IllegalStateException - when the model is sortable.ExceptionIModifyableTableModel.add(int, java.lang.Object)public void add(@Nonnull K row) throws Exception
Collection.add(Object).add in interface IModifyableTableModel<K>ExceptionIModifyableTableModel.add(java.lang.Object)@Nullable public K delete(int index) throws Exception
Collection.remove(Object).delete in interface IModifyableTableModel<K>ExceptionIModifyableTableModel.delete(int)public boolean delete(@Nonnull K val) throws Exception
delete in interface IModifyableTableModel<K>ExceptionIModifyableTableModel.delete(java.lang.Object)public void modified(int index)
throws Exception
index - Exceptionpublic void modified(K key) throws Exception
key - ExceptionCopyright © 2017 etc.to. All rights reserved.