org.apache.ignite.ml.knn.utils

## Class PointWithDistance<L>

- java.lang.Object
- - org.apache.ignite.ml.knn.utils.PointWithDistance<L>

- Type Parameters:
    `L` - Label type.
  All Implemented Interfaces:
    Comparable<PointWithDistance>

      public final class PointWithDistance<L>
      extends Object
      implements Comparable<PointWithDistance>

  Utils class to be used in heap to compare two point using their distances to target point. Note: this class has a natural ordering that is inconsistent with equals.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PointWithDistance(LabeledVector<L> pnt, double distance)` Constructs a new instance of data point with distance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(PointWithDistance o)`
    `double` | `getDistance()`
    `LabeledVector<L>` | `getPnt()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PointWithDistance

          public PointWithDistance(LabeledVector<L> pnt,
                                   double distance)

      Constructs a new instance of data point with distance.
      Parameters:
        `pnt` - Data point.
        `distance` - Distance to target point.

  - ### Method Detail

    - #### getPnt

          public LabeledVector<L> getPnt()

    - #### getDistance

          public double getDistance()

    - #### compareTo

          public int compareTo(PointWithDistance o)

      Specified by:
        `compareTo` in interface `Comparable<PointWithDistance>`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021