net.sourceforge.xwing
Class DiffingListModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended bynet.sourceforge.xwing.DiffingListModel
All Implemented Interfaces:
ListModel, Serializable

public class DiffingListModel
extends AbstractListModel

A ListModel that accepts wholesale updates to its contents in the form of new Lists but reports as changes only the differences.

Version:
$Revision: 1.2 $
Author:
Scott Howlett
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
DiffingListModel()
          Create a new empty DiffingListModel.
DiffingListModel(List initialValue)
          Create a new DiffingListModel from the supplied initial value.
 
Method Summary
 Object getElementAt(int index)
           
 int getSize()
           
 void setList(List newValue)
          Set our contents to the supplied value.
 
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

DiffingListModel

public DiffingListModel()
Create a new empty DiffingListModel.


DiffingListModel

public DiffingListModel(List initialValue)
Create a new DiffingListModel from the supplied initial value.

Parameters:
initialValue - The initial value of this DiffingListModel.
Method Detail

setList

public void setList(List newValue)
Set our contents to the supplied value. We will calculate the delta between our previous content and the new content and broadcast an appropriate ListDataEvent.

Parameters:
newValue - Our new content.

getSize

public int getSize()

getElementAt

public Object getElementAt(int index)


Copyright © 2003 The Xwing Project. All Rights Reserved.