Enum Distance.Algorithm
- java.lang.Object
-
- java.lang.Enum<Distance.Algorithm>
-
- com.runemate.game.api.hybrid.util.calculations.Distance.Algorithm
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Distance.Algorithm>
- Enclosing class:
- Distance
public static enum Distance.Algorithm extends java.lang.Enum<Distance.Algorithm>
A variety of algorithms used for calculating distances.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CHEBYSHEV
EUCLIDEAN
EUCLIDEAN_SQUARED
MANHATTAN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
calculate(double startX, double startY, double destinationX, double destinationY)
abstract double
calculate(long startX, long startY, long destinationX, long destinationY)
static Distance.Algorithm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Distance.Algorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EUCLIDEAN
public static final Distance.Algorithm EUCLIDEAN
-
EUCLIDEAN_SQUARED
public static final Distance.Algorithm EUCLIDEAN_SQUARED
-
MANHATTAN
public static final Distance.Algorithm MANHATTAN
-
CHEBYSHEV
public static final Distance.Algorithm CHEBYSHEV
-
-
Method Detail
-
values
public static Distance.Algorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Distance.Algorithm c : Distance.Algorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Distance.Algorithm valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
calculate
public abstract double calculate(double startX, double startY, double destinationX, double destinationY)
-
calculate
public abstract double calculate(long startX, long startY, long destinationX, long destinationY)
-
-