edu.nrao.sss.catalog
Interface CatalogListener<I extends CatalogItem<I>,G extends CatalogItemGroup<I,G,C>,C extends Catalog<I,G,C>>


public interface CatalogListener<I extends CatalogItem<I>,G extends CatalogItemGroup<I,G,C>,C extends Catalog<I,G,C>>

A listener of changes to a catalog. The monitored events are all related to the addition, removal, replacement, or movement of items and groups of catalog items.

CVS Info:

$Revision: 1356 $
$Date: 2008-06-17 16:36:05 -0600 (Tue, 17 Jun 2008) $
$Author: dharland $

Since:
2006-11-07
Author:
David M. Harland

Method Summary
 void groupAdded(C catalog, G newGroup, int index)
          Called after newGroup was added to catalog.
 void groupMoved(C catalog, G group, int fromIndex, int toIndex)
          Called after group was moved from one location to another within catalog.
 void groupRemoved(C catalog, G formerGroup, int index)
          Called after formerGroup was removed from catalog.
 void groupReplaced(C catalog, G formerGroup, G newGroup, int index)
          Called after the group located at index was replaced by another group.
 void groupsSorted(C catalog)
          Called after the groups in this catalog were sorted.
 void itemAdded(C catalog, I newItem, int index)
          Called after newItem was added to catalog.
 void itemMoved(C catalog, I item, int fromIndex, int toIndex)
          Called after item was moved from one location to another within catalog.
 void itemRemoved(C catalog, I formerItem, int index)
          Called after formerItem was removed from catalog.
 void itemReplaced(C catalog, I formerItem, I newItem, int index)
          Called after the item located at index was replaced by another item.
 void itemsSorted(C catalog)
          Called after the items in this catalog were sorted.
 

Method Detail

itemAdded

void itemAdded(C catalog,
               I newItem,
               int index)
Called after newItem was added to catalog.

Parameters:
catalog - the catalog to which a new item was added.
newItem - the new item added to catalog.
index - the index at which the new item was added.

itemRemoved

void itemRemoved(C catalog,
                 I formerItem,
                 int index)
Called after formerItem was removed from catalog.

Parameters:
catalog - the catalog from which an item was removed.
formerItem - the item removed from catalog.
index - the index at which the former item had been located.

itemMoved

void itemMoved(C catalog,
               I item,
               int fromIndex,
               int toIndex)
Called after item was moved from one location to another within catalog.

It is anticipated that most implementations of Catalog will send this message only for the item that instigated the change in this list. For example, if the last item of the list was moved to the first position in the list, only one message will be sent, even though every item of the list is now in a new position. The message sent for this example would be for the item now in the first position.

Parameters:
catalog - the catalog in which movement occcurred.
item - the item whose position changed.
fromIndex - the position at which the item had been located.
toIndex - the position at which the item is now located.

itemReplaced

void itemReplaced(C catalog,
                  I formerItem,
                  I newItem,
                  int index)
Called after the item located at index was replaced by another item.

Parameters:
catalog - the catalog in which the replacement occurred.
formerItem - the item that had been located at index.
newItem - the item that is now located at index.
index - the position at which the replacement occurred.

itemsSorted

void itemsSorted(C catalog)
Called after the items in this catalog were sorted.

Parameters:
catalog - the catalog whose items were sorted.

groupAdded

void groupAdded(C catalog,
                G newGroup,
                int index)
Called after newGroup was added to catalog.

Parameters:
catalog - the catalog to which a new group was added.
newGroup - the new group added to catalog.
index - the index at which the new group was added.

groupRemoved

void groupRemoved(C catalog,
                  G formerGroup,
                  int index)
Called after formerGroup was removed from catalog.

Parameters:
catalog - the catalog from which a group was removed.
formerGroup - the group removed from catalog.
index - the index at which the former group had been located.

groupMoved

void groupMoved(C catalog,
                G group,
                int fromIndex,
                int toIndex)
Called after group was moved from one location to another within catalog.

It is anticipated that most implementations of Catalog will send this message only for the group that instigated the change in this list. For example, if the last group of the list was moved to the first position in the group, only one message will be sent, even though every group of the list is now in a new position. The message sent for this example would be for the group now in the first position.

Parameters:
catalog - the catalog in which movement occcurred.
group - the group whose position changed.
fromIndex - the position at which the group had been located.
toIndex - the position at which the group is now located.

groupReplaced

void groupReplaced(C catalog,
                   G formerGroup,
                   G newGroup,
                   int index)
Called after the group located at index was replaced by another group.

Parameters:
catalog - the catalog in which the replacement occurred.
formerGroup - the group that had been located at index.
newGroup - the group that is now located at index.
index - the position at which the replacement occurred.

groupsSorted

void groupsSorted(C catalog)
Called after the groups in this catalog were sorted.

Parameters:
catalog - the catalog whose groups were sorted.


Copyright © 2009. All Rights Reserved.