com.jaxfront.core.util
Class QueueListModel

java.lang.Object
  extended by com.jaxfront.core.util.Queue
      extended by com.jaxfront.core.util.QueueListModel
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List, javax.swing.ListModel

public class QueueListModel
extends Queue
implements javax.swing.ListModel


Constructor Summary
QueueListModel()
           
 
Method Summary
 void addListDataListener(javax.swing.event.ListDataListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 java.lang.Object dequeue()
          Removes the element at the top of the queue.
 java.lang.Object enqueue(java.lang.Object element)
          Inserts a new element at the rear of the queue.
 java.lang.Object enqueueUnique(java.lang.Object element)
          Inserts a new element at the rear of the queue.
 java.lang.Object getElementAt(int index)
           
 javax.swing.event.ListDataListener[] getListDataListeners()
          Returns an array of all the list data listeners registered on this AbstractListModel.
 java.util.EventListener[] getListeners(java.lang.Class listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this model.
 int getSize()
           
 void removeListDataListener(javax.swing.event.ListDataListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void setSelectedItem(java.lang.Object anObject)
          Set the value of the selected item.
 
Methods inherited from class com.jaxfront.core.util.Queue
add, add, addAll, addAll, clear, contains, containsAll, empty, exportToCSV, front, get, getItems, indexOf, initFromCSV, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, toInverseArray, toInverseArray
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

QueueListModel

public QueueListModel()
Method Detail

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addListDataListener in interface javax.swing.ListModel
Parameters:
l - the ListDataListener to be added

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeListDataListener in interface javax.swing.ListModel
Parameters:
l - the ListDataListener to be removed

getListDataListeners

public javax.swing.event.ListDataListener[] getListDataListeners()
Returns an array of all the list data listeners registered on this AbstractListModel.

Returns:
all of this model's ListDataListeners, or an empty array if no list data listeners are currently registered
Since:
1.4
See Also:
addListDataListener(javax.swing.event.ListDataListener), removeListDataListener(javax.swing.event.ListDataListener)

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerType)
Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a list model m for its list data listeners with the following code:

 ListDataListener[] ldls = (ListDataListener[]) (m.getListeners(ListDataListener.class));
 
If no such listeners exist, this method returns an empty array.

Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this model, or an empty array if no such listeners have been added
Throws:
java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Since:
1.3
See Also:
getListDataListeners()

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

setSelectedItem

public void setSelectedItem(java.lang.Object anObject)
Set the value of the selected item. The selected item may be null.

Parameters:
anObject - The combo box value or null for no selection.

enqueue

public java.lang.Object enqueue(java.lang.Object element)
Description copied from class: Queue
Inserts a new element at the rear of the queue.

Overrides:
enqueue in class Queue
Parameters:
element - element to be inserted.

enqueueUnique

public java.lang.Object enqueueUnique(java.lang.Object element)
Description copied from class: Queue
Inserts a new element at the rear of the queue.

Overrides:
enqueueUnique in class Queue
Parameters:
element - element to be inserted.

dequeue

public java.lang.Object dequeue()
Description copied from class: Queue
Removes the element at the top of the queue.

Overrides:
dequeue in class Queue
Returns:
the removed element.