VectorType
- Type of Vectorizable.DataType
- Type of output data.PairType
- Type of Pair.protected static class KDTree.Neighborhood<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>>
extends java.util.AbstractCollection<PairType>
Modifier and Type | Class and Description |
---|---|
protected class |
KDTree.Neighborhood.Neighbor<VectorType extends Vectorizable,DataType,PairType extends Pair<? extends VectorType,DataType>>
Holds neighbor information used during the evaluate method and is put
into a priority queue.
|
protected class |
KDTree.Neighborhood.NeighborhoodIterator
Iterator for the Neighborhood.
|
Constructor and Description |
---|
Neighborhood(int k)
Creates a new Neighborhood.
|
Modifier and Type | Method and Description |
---|---|
void |
add(PairType value,
double distance)
Adds the neighbor to the priority queue.
|
double |
getFurthestNeighborDistance()
Returns the distance of the furthest Neighbor.
|
boolean |
isFull()
Returns true if the Neighborhood is full.
|
java.util.Iterator<PairType> |
iterator() |
boolean |
offer(PairType value,
double distance)
Offers the neighbor if there is space or it's closer than the
furthest neighbor.
|
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Neighborhood(int k)
k
- Maximum number of Neighbors in the Neighborhood.public boolean isFull()
public double getFurthestNeighborDistance()
public void add(PairType value, double distance)
value
- Value to add.distance
- Distance to associate with the neighbor to the queue.public boolean offer(PairType value, double distance)
value
- Value of the neighbor.distance
- Distance to the key value.public java.util.Iterator<PairType> iterator()
iterator
in interface java.lang.Iterable<PairType extends Pair<? extends VectorType,DataType>>
iterator
in interface java.util.Collection<PairType extends Pair<? extends VectorType,DataType>>
iterator
in class java.util.AbstractCollection<PairType extends Pair<? extends VectorType,DataType>>
public int size()
size
in interface java.util.Collection<PairType extends Pair<? extends VectorType,DataType>>
size
in class java.util.AbstractCollection<PairType extends Pair<? extends VectorType,DataType>>