test_class.declarator: comp
test_class.modifier: private
test_class.original_string: private GeopositionComparator comp;
test_class.type: GeopositionComparator
test_class.var_name: comp
test_class.file: lib/Duke/duke-core/src/test/java/no/priv/garshol/duke/comparators/GeopositionComparatorTest.java
test_class.identifier: GeopositionComparatorTest
test_case.body: @Test
    public void testMalformed() {
      assertEquals(0.5, comp.compare("41.5,27.2", "41.5127.21"));
    }
test_case.class_method_signature: GeopositionComparatorTest.testMalformed()
test_case.full_signature: @Test public void testMalformed()
test_case.identifier: testMalformed
test_case.invocations: assertEquals compare
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMalformed()
focal_class.declarator: R = 6371000
focal_class.modifier: private static final
focal_class.original_string: private static final double R = 6371000;
focal_class.type: double
focal_class.var_name: R
focal_class.declarator: maxdist
focal_class.modifier: private
focal_class.original_string: private double maxdist;
focal_class.type: double
focal_class.var_name: maxdist
focal_class.declarator: strict
focal_class.modifier: private
focal_class.original_string: private boolean strict;
focal_class.type: boolean
focal_class.var_name: strict
focal_class.file: lib/Duke/duke-core/src/main/java/no/priv/garshol/duke/comparators/GeopositionComparator.java
focal_class.identifier: GeopositionComparator
focal_class.interfaces: implements Comparator
focal_class.class_method_signature: GeopositionComparator.GeopositionComparator()
focal_class.full_signature: public  GeopositionComparator()
focal_class.identifier: GeopositionComparator
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  GeopositionComparator()
focal_class.class_method_signature: GeopositionComparator.isTokenized()
focal_class.full_signature: @Override public boolean isTokenized()
focal_class.identifier: isTokenized
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isTokenized()
focal_class.class_method_signature: GeopositionComparator.compare(String v1, String v2)
focal_class.full_signature: @Override public double compare(String v1, String v2)
focal_class.identifier: compare
focal_class.modifiers: @Override public
focal_class.parameters: (String v1, String v2)
focal_class.return: double
focal_class.signature: double compare(String v1, String v2)
focal_class.class_method_signature: GeopositionComparator.setStrict(boolean strict)
focal_class.full_signature: public void setStrict(boolean strict)
focal_class.identifier: setStrict
focal_class.modifiers: public
focal_class.parameters: (boolean strict)
focal_class.return: void
focal_class.signature: void setStrict(boolean strict)
focal_class.class_method_signature: GeopositionComparator.setMaxDistance(double maxdist)
focal_class.full_signature: public void setMaxDistance(double maxdist)
focal_class.identifier: setMaxDistance
focal_class.modifiers: public
focal_class.parameters: (double maxdist)
focal_class.return: void
focal_class.signature: void setMaxDistance(double maxdist)
focal_class.class_method_signature: GeopositionComparator.getMaxDistance()
focal_class.full_signature: public double getMaxDistance()
focal_class.identifier: getMaxDistance
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: double
focal_class.signature: double getMaxDistance()
focal_class.class_method_signature: GeopositionComparator.distance(double lat1, double lon1,
              double lat2, double lon2)
focal_class.full_signature: public static double distance(double lat1, double lon1,
              double lat2, double lon2)
focal_class.identifier: distance
focal_class.modifiers: public static
focal_class.parameters: (double lat1, double lon1,
              double lat2, double lon2)
focal_class.return: double
focal_class.signature: double distance(double lat1, double lon1,
              double lat2, double lon2)
focal_class.class_method_signature: GeopositionComparator.getLongitude(String v)
focal_class.full_signature: private static double getLongitude(String v)
focal_class.identifier: getLongitude
focal_class.modifiers: private static
focal_class.parameters: (String v)
focal_class.return: double
focal_class.signature: double getLongitude(String v)
focal_class.class_method_signature: GeopositionComparator.getLatitude(String v)
focal_class.full_signature: private static double getLatitude(String v)
focal_class.identifier: getLatitude
focal_class.modifiers: private static
focal_class.parameters: (String v)
focal_class.return: double
focal_class.signature: double getLatitude(String v)
focal_class.class_method_signature: GeopositionComparator.valid(double lat, double lon)
focal_class.full_signature: private boolean valid(double lat, double lon)
focal_class.identifier: valid
focal_class.modifiers: private
focal_class.parameters: (double lat, double lon)
focal_class.return: boolean
focal_class.signature: boolean valid(double lat, double lon)
focal_method.body: @Override
      public double compare(String v1, String v2) {
          try {
              double lat1 = getLatitude(v1);
              double lon1 = getLongitude(v1);
              double lat2 = getLatitude(v2);
              double lon2 = getLongitude(v2);
  
              if (!valid(lat1, lon1) || !valid(lat2, lon2))
                  return 0.5;
  
              double dist = distance(lat1, lon1, lat2, lon2);
              if (dist > maxdist)
                  return 0.0;
  
              return ((1.0 - (dist / maxdist)) * 0.5 ) + 0.5;
          } catch (NumberFormatException e) {
              if (strict)
                  throw new DukeException("Invalid number: " + e, e);
              return 0.5;
          }
      }
focal_method.class_method_signature: GeopositionComparator.compare(String v1, String v2)
focal_method.full_signature: @Override public double compare(String v1, String v2)
focal_method.identifier: compare
focal_method.invocations: getLatitude getLongitude getLatitude getLongitude valid valid distance
focal_method.modifiers: @Override public
focal_method.parameters: (String v1, String v2)
focal_method.return: double
focal_method.signature: double compare(String v1, String v2)