Enum 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.
    • 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.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        java.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)