@Test public void fromStringValidTest() { String boundingBoxString = MIN_LATITUDE + DELIMITER + MIN_LONGITUDE + DELIMITER + MAX_LATITUDE + DELIMITER + MAX_LONGITUDE; BoundingBox boundingBox = BoundingBox.fromString(boundingBoxString); Assert.assertEquals(MIN_LATITUDE, boundingBox.minLatitude, 0); Assert.assertEquals(MIN_LONGITUDE, boundingBox.minLongitude, 0); Assert.assertEquals(MAX_LATITUDE, boundingBox.maxLatitude, 0); Assert.assertEquals(MAX_LONGITUDE, boundingBox.maxLongitude, 0); }
public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = CoordinatesUtil.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); }
BoundingBox implements Serializable { public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = CoordinatesUtil.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); } }
BoundingBox implements Serializable { public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = CoordinatesUtil.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude); }
BoundingBox implements Serializable { public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = CoordinatesUtil.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude); static BoundingBox fromString(String boundingBoxString); boolean contains(GeoPoint geoPoint); @Override boolean equals(Object obj); GeoPoint getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); @Override String toString(); }
BoundingBox implements Serializable { public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = CoordinatesUtil.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); } BoundingBox(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude); static BoundingBox fromString(String boundingBoxString); boolean contains(GeoPoint geoPoint); @Override boolean equals(Object obj); GeoPoint getCenterPoint(); double getLatitudeSpan(); double getLongitudeSpan(); @Override int hashCode(); boolean intersects(BoundingBox boundingBox); @Override String toString(); final double maxLatitude; final double maxLongitude; final double minLatitude; final double minLongitude; }