Package elki.index.preprocessed.knn
Class KNNChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- elki.index.preprocessed.knn.KNNChangeEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class KNNChangeEvent extends java.util.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 subscribedKNNListener
of the change.- Since:
- 0.4.0
- Author:
- Elke Achtert
- See Also:
KNNListener
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KNNChangeEvent.Type
Available event types.
-
Field Summary
Fields Modifier and Type Field Description 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.
-
Constructor Summary
Constructors Constructor Description KNNChangeEvent(java.lang.Object source, KNNChangeEvent.Type type, DBIDs objects, DBIDs updates)
Used to create an event when kNNs of some objects have been changed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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(java.lang.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 eventtype
- the type of changeobjects
- 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
orKNNChangeEvent.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
-
-