org.geotoolkit.coverage.sql
Class CoverageDatabaseEvent

Object
  extended by EventObject
      extended by CoverageDatabaseEvent
All Implemented Interfaces:
Serializable

public class CoverageDatabaseEvent
extends EventObject

The event delivered when the content of a Coverage Database changes. The change can be the addition of entries or the removal of an existing entries, as determined by the sign of getNumEntryChange().

Events can be delivered twice: before and after the change, in order to allow listeners to veto the change before it occurs or to update some internal representation once the change is completed.

Since:
3.12
Version:
3.12
Author:
Martin Desruisseaux (Geomatys)
See Also:
CoverageDatabaseListener, Serialized Form
Module:
coverage/geotk-coverage-sql (download)    View source code for this class

Field Summary
 
Fields inherited from class EventObject
source
 
Constructor Summary
CoverageDatabaseEvent(CoverageDatabase source, boolean isBefore, int numEntryChange)
          Creates a new event having the given database as its source.
 
Method Summary
 int getNumEntryChange()
          Returns whatever new entries are added or existing entries removed, and how many of them.
 CoverageDatabase getSource()
          Returns the database in which entries are added or removed.
 boolean isBefore()
          Returns whetever this event is occuring before the change is actually applied in the database.
 
Methods inherited from class EventObject
toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoverageDatabaseEvent

public CoverageDatabaseEvent(CoverageDatabase source,
                             boolean isBefore,
                             int numEntryChange)
Creates a new event having the given database as its source.

Parameters:
source - The source of this event.
isBefore - true if the event is invoked before the change, or false if the event occurs after the change.
numEntryChange - Number of entries added, or a negative number if entries are being removed.
Method Detail

getSource

public CoverageDatabase getSource()
Returns the database in which entries are added or removed.

Overrides:
getSource in class EventObject

isBefore

public boolean isBefore()
Returns whetever this event is occuring before the change is actually applied in the database. Listeners can veto the change before it is applied, but can not veto the change after it has been applied.

Returns:
true if the event occurs before the change, or false if the event occurs after the change.

getNumEntryChange

public int getNumEntryChange()
Returns whatever new entries are added or existing entries removed, and how many of them. This method typically returns +1 or -1, but is not restricted to those values.

Returns:
Number of entries added, or a negative number if entries are being removed.


Copyright © 2009-2013 Geotoolkit.org. All Rights Reserved.