|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.utils.math.DistanceUtils
public class DistanceUtils
Constructor Summary | |
---|---|
DistanceUtils()
|
Method Summary | ||
---|---|---|
static
|
getNearest(java.util.Collection<T> locations,
ILocated target)
Returns the nearest object to 'target'. |
|
static
|
getNearest2D(java.util.Collection<T> locations,
ILocated target)
Returns the nearest object to 'target' (ignoring 'z' coordinate). |
|
static
|
getNearestFiltered(java.util.Collection<T> locations,
ILocated target,
IFilter<T> filter)
Returns the nearest object to 'target'. |
|
static
|
getNearestFiltered2D(java.util.Collection<T> locations,
ILocated target,
IFilter<T> filter)
Returns the nearest object to 'target' (ignoring 'z' coordinate). |
|
static
|
getNearestVisible(java.util.Collection<T> locations,
ILocated target)
Returns the nearest object to 'target'. |
|
static
|
getNearestVisible2D(java.util.Collection<T> locations,
ILocated target)
Returns the nearest object to 'target' (ignoring 'z' coordinate). |
|
static
|
getSecondNearest(java.util.Collection<T> locations,
ILocated target)
Returns the second nearest object to 'target'. |
|
static
|
getSecondNearest2D(java.util.Collection<T> locations,
ILocated target)
Returns the second nearest object to 'target' (ignoring 'z' coordinate). |
|
static
|
getSecondNearestVisible(java.util.Collection<T> locations,
ILocated target)
Returns the second nearest object to 'target'. |
|
static
|
getSecondNearestVisible2D(java.util.Collection<T> locations,
ILocated target)
Returns the second nearest object to 'target' (ignoring 'z' coordinate). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DistanceUtils()
Method Detail |
---|
public static <T extends ILocated> T getNearest(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends ILocated> T getNearestFiltered(java.util.Collection<T> locations, ILocated target, IFilter<T> filter)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends ILocated> T getSecondNearest(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends IViewable> T getNearestVisible(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- must be objects implementing IViewable
as well as ILocated
(so Item
or Player
is usable)target
-
public static <T extends IViewable> T getSecondNearestVisible(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- must be objects implementing IViewable
as well as ILocated
(so Item
or Player
is usable)target
-
public static <T extends ILocated> T getNearest2D(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends ILocated> T getNearestFiltered2D(java.util.Collection<T> locations, ILocated target, IFilter<T> filter)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends ILocated> T getSecondNearest2D(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- target
-
public static <T extends IViewable> T getNearestVisible2D(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- must be objects implementing IViewable
as well as ILocated
(so Item
or Player
is usable)target
-
public static <T extends IViewable> T getSecondNearestVisible2D(java.util.Collection<T> locations, ILocated target)
WARNING: O(n) complexity!
T
- locations
- must be objects implementing IViewable
as well as ILocated
(so Item
or Player
is usable)target
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |