|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractListModel com.isti.util.gui.FifoHashListModel
Class FifoHashListModel encasulates an 'UnsyncFifoHashtable' object and uses it in a 'ListModel' implementation suitable for use in a 'JList'. Methods are not thread synchronized.
Field Summary | |
protected UnsyncFifoHashtable |
hashtableObj
|
protected boolean |
listenersEnabledFlag
|
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
FifoHashListModel()
|
Method Summary | |
void |
clear()
Clears the hashtable data. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in the hashtable data. |
boolean |
containsKey(java.lang.Object key)
Tests if the specified object is a key in the hashtable data. |
boolean |
containsValue(java.lang.Object value)
Returns true if the hashtable data maps one or more keys to this value. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in the hashtable data. |
void |
fireContentsChanged()
Fires a contents-changed event. |
protected void |
fireItemPut(int preIdx,
java.lang.Object key)
Notifies listeners of a 'put' operation. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the hashtable data maps the specified key. |
java.lang.Object |
getElementAt(int indexVal)
Returns the element at the given index value. |
int |
getSize()
Returns the current size of the hashtable table data held by this object. |
java.util.Vector |
getValuesVector()
Returns a new Vector containing the values in the hashtable data. |
int |
indexOf(java.lang.Object obj)
Searches for the first occurrence of the given argument, testing for equality using the equals method. |
int |
indexOfKey(java.lang.Object obj)
Searches for the first occurrence of the given key, testing for equality using the equals method. |
java.lang.Object |
keyAt(int idx)
Returns the key at the specified index in the hashtable data. |
int |
lastIndexOf(java.lang.Object obj)
Searches for the last occurrence of the given argument, testing for equality using the equals method. |
int |
lastIndexOfKey(java.lang.Object obj)
Searches for the last occurrence of the given key, testing for equality using the equals method. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in the hashtable data. |
void |
putAll(java.util.Map mapObj)
Copies all of the mappings from the specified map into the table. |
java.lang.Object |
putSort(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag)
Adds a key/value pair to the hashtable data, placing it in sorted order according to the key. |
java.lang.Object |
putSort(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag,
java.util.Comparator compObj)
Adds a key/value pair to the hashtable table, placing it in sorted order according to the key. |
java.lang.Object |
putSort(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag,
int sortType)
Adds a key/value pair to the hashtable data, placing it in sorted order according to the key. |
void |
putSortAll(java.util.Map mapObj,
boolean sortDirFlag)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the keys. |
void |
putSortAll(java.util.Map mapObj,
boolean sortDirFlag,
java.util.Comparator compObj)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the keys. |
void |
putSortAll(java.util.Map mapObj,
boolean sortDirFlag,
int sortType)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the keys. |
java.lang.Object |
putSortByValue(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag)
Adds a key/value pair to the hashtable data, placing it in sorted order according to the value. |
java.lang.Object |
putSortByValue(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag,
java.util.Comparator compObj)
Adds a key/value pair to the hashtable, placing it in sorted order according to the value. |
java.lang.Object |
putSortByValue(java.lang.Object key,
java.lang.Object value,
boolean sortDirFlag,
int sortType)
Adds a key/value pair to the hashtable data, placing it in sorted order according to the value. |
void |
putSortByValueAll(java.util.Map mapObj,
boolean sortDirFlag)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the values. |
void |
putSortByValueAll(java.util.Map mapObj,
boolean sortDirFlag,
java.util.Comparator compObj)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the values. |
void |
putSortByValueAll(java.util.Map mapObj,
boolean sortDirFlag,
int sortType)
Copies all of the mappings from the specified map into the table, placing them in sorted order according to the values. |
void |
removeElementAt(int indexVal)
Removes the entry at the specified index in the hashtable data. |
java.lang.Object |
removeKey(java.lang.Object key)
Removes the mapping for the given key from this hashtable if present. |
java.lang.Object |
removeValue(java.lang.Object obj)
Removes the value and its key from this hashtable data if present. |
void |
reSortList(boolean sortDirFlag,
int sortType)
Resorts the list with the specified direction and type. |
void |
setListenersEnabled(boolean flgVal)
Sets whether or not attached 'ListDataListener' objects are called when changes occur. |
java.util.Collection |
values()
Returns a read-only collection view of the values contained in the hashtable data. |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final UnsyncFifoHashtable hashtableObj
protected boolean listenersEnabledFlag
Constructor Detail |
public FifoHashListModel()
Method Detail |
public int getSize()
public java.lang.Object getElementAt(int indexVal)
indexVal
- the index value to use.
java.lang.ArrayIndexOutOfBoundsException
- if the index is negative
or not less than the current size of the hashtable data.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
public void putAll(java.util.Map mapObj)
mapObj
- mappings to be stored in this map.public java.lang.Object putSort(java.lang.Object key, java.lang.Object value, boolean sortDirFlag)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.
public java.lang.Object putSort(java.lang.Object key, java.lang.Object value, boolean sortDirFlag, int sortType)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.sortType
- the sort type.
public java.lang.Object putSort(java.lang.Object key, java.lang.Object value, boolean sortDirFlag, java.util.Comparator compObj)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.compObj
- the comparator to use for sorting the 'key' objects,
or null to use the "natural" sort order.
public void putSortAll(java.util.Map mapObj, boolean sortDirFlag)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.public void putSortAll(java.util.Map mapObj, boolean sortDirFlag, int sortType)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.sortType
- the sort type.public void putSortAll(java.util.Map mapObj, boolean sortDirFlag, java.util.Comparator compObj)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.compObj
- the comparator to use for sorting the 'key' objects,
or null to use the "natural" sort order.public java.lang.Object putSortByValue(java.lang.Object key, java.lang.Object value, boolean sortDirFlag)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.
public java.lang.Object putSortByValue(java.lang.Object key, java.lang.Object value, boolean sortDirFlag, int sortType)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.sortType
- the sort type.
public java.lang.Object putSortByValue(java.lang.Object key, java.lang.Object value, boolean sortDirFlag, java.util.Comparator compObj)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.sortDirFlag
- true for ascending sort order, false for
descending.compObj
- the comparator to use for sorting the 'key' objects,
or null to use the "natural" sort order.
public void putSortByValueAll(java.util.Map mapObj, boolean sortDirFlag)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.public void putSortByValueAll(java.util.Map mapObj, boolean sortDirFlag, int sortType)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.sortType
- the sort type.public void putSortByValueAll(java.util.Map mapObj, boolean sortDirFlag, java.util.Comparator compObj)
mapObj
- mappings to be stored in this map.sortDirFlag
- true for ascending sort order, false for
descending.compObj
- the comparator to use for sorting the 'value' objects,
or null to use the "natural" sort order.public java.lang.Object get(java.lang.Object key)
key
- key whose associated value is to be returned.
public java.lang.Object removeKey(java.lang.Object key)
key
- key whose mapping is to be removed from the hashtable.
public java.lang.Object removeValue(java.lang.Object obj)
obj
- value to be removed from the hashtable.
public void removeElementAt(int indexVal)
indexVal
- the specified index; must be greater than or equal to
zero and less than the size of the table.
java.lang.ArrayIndexOutOfBoundsException
- if the index is negative
or not less than the current size of the table.public void reSortList(boolean sortDirFlag, int sortType)
sortDirFlag
- true for ascending sort order, false for
descending.sortType
- the sort type.public boolean containsKey(java.lang.Object key)
key
- possible key.
true
if and only if the specified object
is a key in the hashtable data, as determined by the
equals method; false
otherwise.public boolean containsValue(java.lang.Object value)
value
- the value to use.
true
if and only if some key maps to the
value
argument in the hashtable data as
determined by the equals method;
false
otherwise.public boolean contains(java.lang.Object value)
value
- the value to use.
true
if and only if some key maps to the
value
argument in the hashtable data as
determined by the equals method;
false
otherwise.public int indexOf(java.lang.Object obj)
obj
- the object to find.
public int lastIndexOf(java.lang.Object obj)
obj
- the object to find.
public int indexOfKey(java.lang.Object obj)
obj
- the key to find.
public int lastIndexOfKey(java.lang.Object obj)
obj
- the key to find.
public java.lang.Object keyAt(int idx)
idx
- the index value to use.
java.lang.ArrayIndexOutOfBoundsException
- if the index is negative
or not less than the current size of the hashtable data.public void clear()
public java.util.Enumeration elements()
public java.util.Vector getValuesVector()
public java.util.Collection values()
public void setListenersEnabled(boolean flgVal)
flgVal
- true to enable calling of 'ListDataListener' objects,
false to disable.public void fireContentsChanged()
protected void fireItemPut(int preIdx, java.lang.Object key)
preIdx
- the previous index of the given key (before the 'put'
operation) or -1 if not previously in table.key
- the key object to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |