de.lmu.ifi.dbs.elki.index.preprocessed.knn
Class KNNChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by de.lmu.ifi.dbs.elki.index.preprocessed.knn.KNNChangeEvent
All Implemented Interfaces:
Serializable

public class KNNChangeEvent
extends EventObject

Encapsulates information describing changes of the k nearest neighbors (kNNs) of some objects due to insertion or removal of objects. Used to notify all subscribed KNNListener of the change.

See Also:
KNNListener, Serialized Form

Nested Class Summary
static class KNNChangeEvent.Type
          Available event types.
 
Field Summary
private  DBIDs objects
          The ids of the kNNs that were inserted or deleted due to the insertion or removals of objects.
private static long serialVersionUID
          Serialization ID since Java EventObjects are expected to be serializable.
private  KNNChangeEvent.Type type
          Holds the type of this change event.
private  DBIDs updates
          The ids of the kNNs that were updated due to the insertion or removals of objects.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
KNNChangeEvent(Object source, KNNChangeEvent.Type type, DBIDs objects, DBIDs updates)
          Used to create an event when kNNs of some objects have been changed.
 
Method Summary
 DBIDs getObjects()
          Returns the ids of the removed or inserted kNNs (according to the type of this event).
 KNNChangeEvent.Type getType()
          Returns the type of this change event.
 DBIDs getUpdates()
          Returns the ids of kNNs which have been changed due to the removals or insertions.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serialization ID since Java EventObjects are expected to be serializable.

See Also:
Constant Field Values

type

private final KNNChangeEvent.Type type
Holds the type of this change event.

See Also:
KNNChangeEvent.Type

objects

private final DBIDs objects
The ids of the kNNs that were inserted or deleted due to the insertion or removals of objects.


updates

private final DBIDs updates
The ids of the kNNs that were updated due to the insertion or removals of objects.

Constructor Detail

KNNChangeEvent

public KNNChangeEvent(Object source,
                      KNNChangeEvent.Type type,
                      DBIDs objects,
                      DBIDs updates)
Used to create an event when kNNs of some objects have been changed.

Parameters:
source - the object responsible for generating the event
type - the type of change
objects - the ids of the removed or inserted kNNs (according to the type of this event)
updates - the ids of kNNs which have been changed due to the removals or insertions
See Also:
KNNChangeEvent.Type.INSERT, KNNChangeEvent.Type.DELETE
Method Detail

getType

public KNNChangeEvent.Type getType()
Returns the type of this change event.

Returns:
KNNChangeEvent.Type.INSERT or KNNChangeEvent.Type.DELETE

getObjects

public DBIDs getObjects()
Returns the ids of the removed or inserted kNNs (according to the type of this event).

Returns:
the ids of the removed or inserted kNNs

getUpdates

public DBIDs getUpdates()
Returns the ids of kNNs which have been changed due to the removals or insertions.

Returns:
the ids of kNNs which have been changed

Release 0.4.0 (2011-09-20_1324)