Class TargetNodeFilter

  • All Implemented Interfaces:
    NeighbourConsumer

    public final class TargetNodeFilter
    extends java.lang.Object
    implements NeighbourConsumer
    This target node filter evaluates and stores incoming elements (neighbours) with their priority (score). We sort elements by priority, descending. We respect similarity cutoff _unless_ a seed was supplied. For now it is a simple, bounded priority queue backed by a TreeSet. We handle duplicates, in the sense that _exact_ pairs of element and priority, that already exist in the queue, are not added twice - this happens to be the semantics of the TreeSet we use. So no duplicates in the output, even though our dear Knn algorithm does present us with such cases. NB: this data structure would _not_ handle "re-prioritisations" like a neighbour with a different score. Luckily we have convinced ourselves that Knn never presents us with such cases. So this data structure suffices.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void offer​(long element, double priority)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • offer

        public void offer​(long element,
                          double priority)
        Specified by:
        offer in interface NeighbourConsumer