Class 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 subscribed KNNListener 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.
      • Fields inherited from class java.util.EventObject

        source
    • 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.
      • 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
      • 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 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

      • 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