ucar.unidata.view.sounding
Class SoundingObListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by ucar.unidata.view.sounding.SoundingObListModel
All Implemented Interfaces:
Serializable, ListModel

public class SoundingObListModel
extends AbstractListModel

Provides support for adapting a list of sounding observations to the ListModel interface.

Version:
$Id: SoundingObListModel.java,v 1.10 2005/05/13 18:33:38 jeffmc Exp $
Author:
Steven R. Emmerson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
SoundingObListModel()
          Constructs from nothing.
 
Method Summary
 void addSounding(SoundingOb sounding)
          Adds a sounding observation to the list.
 void clearSoundings()
          Clears all sounding observations from the list.
 Object getElementAt(int index)
          Returns the sounding at the given index.
 int getSize()
          Returns the number of soundings.
 void removeSounding(int index)
          Removes a sounding observation from the list.
 void removeSounding(SoundingOb sounding)
          Removes a sounding observation from the list.
 
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
 

Constructor Detail

SoundingObListModel

public SoundingObListModel()
Constructs from nothing.

Method Detail

addSounding

public void addSounding(SoundingOb sounding)
Adds a sounding observation to the list. Notifies ListDataListener-s.

Parameters:
sounding - The sounding observation to be added to the list.

removeSounding

public void removeSounding(SoundingOb sounding)
Removes a sounding observation from the list. Notifies ListDataListener-s.

Parameters:
sounding - The sounding observation to be removed from the list.

removeSounding

public void removeSounding(int index)
Removes a sounding observation from the list. Notifies ListDataListener-s.

Parameters:
index - The index of the sounding observation to be removed from the list.

clearSoundings

public void clearSoundings()
Clears all sounding observations from the list. Notifies ListDataListener-s.


getElementAt

public Object getElementAt(int index)
Returns the sounding at the given index.

Parameters:
index - The index of the sounding.
Returns:
The sounding at the given index. Will be null if there's no such sounding.

getSize

public int getSize()
Returns the number of soundings.

Returns:
The number of soundings.