frog.gui
Class DeviceList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Device>
              extended by frog.gui.DeviceList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Device>, Collection<Device>, List<Device>, RandomAccess, ListModel

public class DeviceList
extends Vector<Device>
implements ListModel

Special list model for use with the FROGUI. This class is a Vector-backed ListModel for use with JLists that need to display devices that are available to the user. Any modifications to the Vector notify the JList of the change so that the new addition may be shown on the JList immediately.

Author:
Team Better Recognize
See Also:
Serialized Form

Field Summary
(package private)  Vector<ListDataListener> listeners
          All ListDataListeners that wish to receive notifications of modification of this ListModel.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DeviceList()
           
 
Method Summary
 boolean add(Device e)
           
 void add(int index, Device element)
           
 boolean addAll(Collection<? extends Device> c)
           
 boolean addAll(int index, Collection<? extends Device> c)
           
 void addElement(Device obj)
           
 void addListDataListener(ListDataListener ldl)
           
 int capacity()
           
 void clear()
           
 Object clone()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 void copyInto(Object[] anArray)
           
 Device elementAt(int index)
           
 Enumeration<Device> elements()
           
 void ensureCapacity(int minCapacity)
           
 boolean equals(Object o)
           
 Device firstElement()
           
 Device get(int index)
           
 Object getElementAt(int index)
           
 int getSize()
           
 int hashCode()
           
 int indexOf(Object o)
           
 int indexOf(Object o, int index)
           
 void insertElementAt(Device obj, int index)
           
 boolean isEmpty()
           
 Device lastElement()
           
 int lastIndexOf(Object o)
           
 int lastIndexOf(Object o, int index)
           
 Device remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 void removeAllElements()
           
 boolean removeElement(Object obj)
           
 void removeElementAt(int index)
           
 void removeListDataListener(ListDataListener l)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean retainAll(Collection<?> c)
           
 Device set(int index, Device element)
           
 void setElementAt(Device obj, int index)
           
 void setSize(int newSize)
           
 int size()
           
 List<Device> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 void trimToSize()
           
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

listeners

Vector<ListDataListener> listeners
All ListDataListeners that wish to receive notifications of modification of this ListModel.

Constructor Detail

DeviceList

public DeviceList()
Method Detail

addListDataListener

public void addListDataListener(ListDataListener ldl)
Specified by:
addListDataListener in interface ListModel

getElementAt

public Object getElementAt(int index)
Specified by:
getElementAt in interface ListModel

getSize

public int getSize()
Specified by:
getSize in interface ListModel

removeListDataListener

public void removeListDataListener(ListDataListener l)
Specified by:
removeListDataListener in interface ListModel

add

public boolean add(Device e)
Specified by:
add in interface Collection<Device>
Specified by:
add in interface List<Device>
Overrides:
add in class Vector<Device>

add

public void add(int index,
                Device element)
Specified by:
add in interface List<Device>
Overrides:
add in class Vector<Device>

addAll

public boolean addAll(Collection<? extends Device> c)
Specified by:
addAll in interface Collection<Device>
Specified by:
addAll in interface List<Device>
Overrides:
addAll in class Vector<Device>

addAll

public boolean addAll(int index,
                      Collection<? extends Device> c)
Specified by:
addAll in interface List<Device>
Overrides:
addAll in class Vector<Device>

addElement

public void addElement(Device obj)
Overrides:
addElement in class Vector<Device>

capacity

public int capacity()
Overrides:
capacity in class Vector<Device>

clear

public void clear()
Specified by:
clear in interface Collection<Device>
Specified by:
clear in interface List<Device>
Overrides:
clear in class Vector<Device>

clone

public Object clone()
Overrides:
clone in class Vector<Device>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Device>
Specified by:
contains in interface List<Device>
Overrides:
contains in class Vector<Device>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Device>
Specified by:
containsAll in interface List<Device>
Overrides:
containsAll in class Vector<Device>

copyInto

public void copyInto(Object[] anArray)
Overrides:
copyInto in class Vector<Device>

elementAt

public Device elementAt(int index)
Overrides:
elementAt in class Vector<Device>

elements

public Enumeration<Device> elements()
Overrides:
elements in class Vector<Device>

ensureCapacity

public void ensureCapacity(int minCapacity)
Overrides:
ensureCapacity in class Vector<Device>

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<Device>
Specified by:
equals in interface List<Device>
Overrides:
equals in class Vector<Device>

firstElement

public Device firstElement()
Overrides:
firstElement in class Vector<Device>

get

public Device get(int index)
Specified by:
get in interface List<Device>
Overrides:
get in class Vector<Device>

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<Device>
Specified by:
hashCode in interface List<Device>
Overrides:
hashCode in class Vector<Device>

indexOf

public int indexOf(Object o,
                   int index)
Overrides:
indexOf in class Vector<Device>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Device>
Overrides:
indexOf in class Vector<Device>

insertElementAt

public void insertElementAt(Device obj,
                            int index)
Overrides:
insertElementAt in class Vector<Device>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Device>
Specified by:
isEmpty in interface List<Device>
Overrides:
isEmpty in class Vector<Device>

lastElement

public Device lastElement()
Overrides:
lastElement in class Vector<Device>

lastIndexOf

public int lastIndexOf(Object o,
                       int index)
Overrides:
lastIndexOf in class Vector<Device>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Device>
Overrides:
lastIndexOf in class Vector<Device>

remove

public Device remove(int index)
Specified by:
remove in interface List<Device>
Overrides:
remove in class Vector<Device>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Device>
Specified by:
remove in interface List<Device>
Overrides:
remove in class Vector<Device>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Device>
Specified by:
removeAll in interface List<Device>
Overrides:
removeAll in class Vector<Device>

removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in class Vector<Device>

removeElement

public boolean removeElement(Object obj)
Overrides:
removeElement in class Vector<Device>

removeElementAt

public void removeElementAt(int index)
Overrides:
removeElementAt in class Vector<Device>

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class Vector<Device>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Device>
Specified by:
retainAll in interface List<Device>
Overrides:
retainAll in class Vector<Device>

set

public Device set(int index,
                  Device element)
Specified by:
set in interface List<Device>
Overrides:
set in class Vector<Device>

setElementAt

public void setElementAt(Device obj,
                         int index)
Overrides:
setElementAt in class Vector<Device>

setSize

public void setSize(int newSize)
Overrides:
setSize in class Vector<Device>

size

public int size()
Specified by:
size in interface Collection<Device>
Specified by:
size in interface List<Device>
Overrides:
size in class Vector<Device>

subList

public List<Device> subList(int fromIndex,
                            int toIndex)
Specified by:
subList in interface List<Device>
Overrides:
subList in class Vector<Device>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Device>
Specified by:
toArray in interface List<Device>
Overrides:
toArray in class Vector<Device>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<Device>
Specified by:
toArray in interface List<Device>
Overrides:
toArray in class Vector<Device>

toString

public String toString()
Overrides:
toString in class Vector<Device>

trimToSize

public void trimToSize()
Overrides:
trimToSize in class Vector<Device>