target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testGetCoordinates() { List<LatLng> coordinates = new ArrayList<>(); coordinates.add(new LatLng(0, 0)); coordinates.add(new LatLng(50, 50)); coordinates.add(new LatLng(100, 100)); ls = new GeoJsonLineString(coordinates); assertEquals(coordinates, ls.getCoordinates()); try { ls = new GeoJsonLineString(...
public List<LatLng> getCoordinates() { return getGeometryObject(); }
GeoJsonLineString extends LineString { public List<LatLng> getCoordinates() { return getGeometryObject(); } }
GeoJsonLineString extends LineString { public List<LatLng> getCoordinates() { return getGeometryObject(); } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); }
GeoJsonLineString extends LineString { public List<LatLng> getCoordinates() { return getGeometryObject(); } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); String getType(); List<LatLng> getCoordinates(); List<Double> getAltitudes(); }
GeoJsonLineString extends LineString { public List<LatLng> getCoordinates() { return getGeometryObject(); } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); String getType(); List<LatLng> getCoordinates(); List<Double> getAltitudes(); }
@Test public void testGetAltitudes() { List<LatLng> coordinates = new ArrayList<>(); coordinates.add(new LatLng(0, 0)); coordinates.add(new LatLng(50, 50)); coordinates.add(new LatLng(100, 100)); List<Double> altitudes = new ArrayList<>(); altitudes.add(100d); altitudes.add(200d); altitudes.add(300d); ls = new GeoJsonL...
public List<Double> getAltitudes() { return mAltitudes; }
GeoJsonLineString extends LineString { public List<Double> getAltitudes() { return mAltitudes; } }
GeoJsonLineString extends LineString { public List<Double> getAltitudes() { return mAltitudes; } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); }
GeoJsonLineString extends LineString { public List<Double> getAltitudes() { return mAltitudes; } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); String getType(); List<LatLng> getCoordinates(); List<Double> getAltitudes(); }
GeoJsonLineString extends LineString { public List<Double> getAltitudes() { return mAltitudes; } GeoJsonLineString(List<LatLng> coordinates); GeoJsonLineString(List<LatLng> coordinates, List<Double> altitudes); String getType(); List<LatLng> getCoordinates(); List<Double> getAltitudes(); }
@Test public void testGetType() { GeoJsonPoint p = new GeoJsonPoint(new LatLng(0, 0)); assertEquals("Point", p.getType()); }
public String getType() { return getGeometryType(); }
GeoJsonPoint extends Point { public String getType() { return getGeometryType(); } }
GeoJsonPoint extends Point { public String getType() { return getGeometryType(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); }
GeoJsonPoint extends Point { public String getType() { return getGeometryType(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
GeoJsonPoint extends Point { public String getType() { return getGeometryType(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
@Test public void testGetCoordinates() { GeoJsonPoint p = new GeoJsonPoint(new LatLng(0, 0)); assertEquals(new LatLng(0, 0), p.getCoordinates()); try { new GeoJsonPoint(null); fail(); } catch (IllegalArgumentException e) { assertEquals("Coordinates cannot be null", e.getMessage()); } }
public LatLng getCoordinates() { return getGeometryObject(); }
GeoJsonPoint extends Point { public LatLng getCoordinates() { return getGeometryObject(); } }
GeoJsonPoint extends Point { public LatLng getCoordinates() { return getGeometryObject(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); }
GeoJsonPoint extends Point { public LatLng getCoordinates() { return getGeometryObject(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
GeoJsonPoint extends Point { public LatLng getCoordinates() { return getGeometryObject(); } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
@Test public void testGetAltitude() { GeoJsonPoint p = new GeoJsonPoint(new LatLng(0, 0), 100d); assertEquals(new Double(100), p.getAltitude()); }
public Double getAltitude() { return mAltitude; }
GeoJsonPoint extends Point { public Double getAltitude() { return mAltitude; } }
GeoJsonPoint extends Point { public Double getAltitude() { return mAltitude; } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); }
GeoJsonPoint extends Point { public Double getAltitude() { return mAltitude; } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
GeoJsonPoint extends Point { public Double getAltitude() { return mAltitude; } GeoJsonPoint(LatLng coordinates); GeoJsonPoint(LatLng coordinates, Double altitude); String getType(); LatLng getCoordinates(); Double getAltitude(); }
@Test public void testGetType() { List<GeoJsonPoint> points = new ArrayList<>(); points.add(new GeoJsonPoint(new LatLng(0, 0))); points.add(new GeoJsonPoint(new LatLng(5, 5))); points.add(new GeoJsonPoint(new LatLng(10, 10))); mp = new GeoJsonMultiPoint(points); assertEquals("MultiPoint", mp.getType()); }
public String getType() { return getGeometryType(); }
GeoJsonMultiPoint extends MultiGeometry { public String getType() { return getGeometryType(); } }
GeoJsonMultiPoint extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPoint(List<GeoJsonPoint> geoJsonPoints); }
GeoJsonMultiPoint extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPoint(List<GeoJsonPoint> geoJsonPoints); String getType(); List<GeoJsonPoint> getPoints(); }
GeoJsonMultiPoint extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPoint(List<GeoJsonPoint> geoJsonPoints); String getType(); List<GeoJsonPoint> getPoints(); }
@Test public void testGetPoints() { List<GeoJsonPoint> points = new ArrayList<>(); points.add(new GeoJsonPoint(new LatLng(0, 0))); points.add(new GeoJsonPoint(new LatLng(5, 5))); points.add(new GeoJsonPoint(new LatLng(10, 10))); mp = new GeoJsonMultiPoint(points); assertEquals(points, mp.getPoints()); points = new Arra...
public List<GeoJsonPoint> getPoints() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPoint> geoJsonPoints = new ArrayList<GeoJsonPoint>(); for (Geometry geometry : geometryList) { GeoJsonPoint point = (GeoJsonPoint) geometry; geoJsonPoints.add(point); } return geoJsonPoints; }
GeoJsonMultiPoint extends MultiGeometry { public List<GeoJsonPoint> getPoints() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPoint> geoJsonPoints = new ArrayList<GeoJsonPoint>(); for (Geometry geometry : geometryList) { GeoJsonPoint point = (GeoJsonPoint) geometry; geoJsonPoints.add(point); } r...
GeoJsonMultiPoint extends MultiGeometry { public List<GeoJsonPoint> getPoints() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPoint> geoJsonPoints = new ArrayList<GeoJsonPoint>(); for (Geometry geometry : geometryList) { GeoJsonPoint point = (GeoJsonPoint) geometry; geoJsonPoints.add(point); } r...
GeoJsonMultiPoint extends MultiGeometry { public List<GeoJsonPoint> getPoints() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPoint> geoJsonPoints = new ArrayList<GeoJsonPoint>(); for (Geometry geometry : geometryList) { GeoJsonPoint point = (GeoJsonPoint) geometry; geoJsonPoints.add(point); } r...
GeoJsonMultiPoint extends MultiGeometry { public List<GeoJsonPoint> getPoints() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPoint> geoJsonPoints = new ArrayList<GeoJsonPoint>(); for (Geometry geometry : geometryList) { GeoJsonPoint point = (GeoJsonPoint) geometry; geoJsonPoints.add(point); } r...
@Test public void testGetType() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add( new ArrayList<>( Arrays.asList( new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0)))); p = new GeoJsonPolygon(coordinates); assertEquals("Polygon", p.getType()); }
public String getType() { return GEOMETRY_TYPE; }
GeoJsonPolygon implements DataPolygon { public String getType() { return GEOMETRY_TYPE; } }
GeoJsonPolygon implements DataPolygon { public String getType() { return GEOMETRY_TYPE; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); }
GeoJsonPolygon implements DataPolygon { public String getType() { return GEOMETRY_TYPE; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); String getType(); List<? extends List<LatLng>> getCoordinates(); List<? extends List<LatLng>> getGeometryObject(); String getGeometryType(); ArrayList<LatLng> ...
GeoJsonPolygon implements DataPolygon { public String getType() { return GEOMETRY_TYPE; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); String getType(); List<? extends List<LatLng>> getCoordinates(); List<? extends List<LatLng>> getGeometryObject(); String getGeometryType(); ArrayList<LatLng> ...
@Test public void testGetCoordinates() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add( new ArrayList<>( Arrays.asList( new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0)))); p = new GeoJsonPolygon(coordinates); assertEquals(coordinates, p.getCoordinates()); coordinates.add...
public List<? extends List<LatLng>> getCoordinates() { return mCoordinates; }
GeoJsonPolygon implements DataPolygon { public List<? extends List<LatLng>> getCoordinates() { return mCoordinates; } }
GeoJsonPolygon implements DataPolygon { public List<? extends List<LatLng>> getCoordinates() { return mCoordinates; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); }
GeoJsonPolygon implements DataPolygon { public List<? extends List<LatLng>> getCoordinates() { return mCoordinates; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); String getType(); List<? extends List<LatLng>> getCoordinates(); List<? extends List<LatLng>> getGeometryObject(); String getGeomet...
GeoJsonPolygon implements DataPolygon { public List<? extends List<LatLng>> getCoordinates() { return mCoordinates; } GeoJsonPolygon( List<? extends List<LatLng>> coordinates); String getType(); List<? extends List<LatLng>> getCoordinates(); List<? extends List<LatLng>> getGeometryObject(); String getGeomet...
@Test public void testSetMap() throws Exception { mLayer = new GeoJsonLayer(mMap1, createFeatureCollection()); mMap1 = mLayer.getMap(); mRenderer.setMap(mMap1); assertEquals(mMap1, mRenderer.getMap()); mRenderer.setMap(null); assertNull(mRenderer.getMap()); }
public void setMap(GoogleMap map) { super.setMap(map); for (Feature feature : super.getFeatures()) { redrawFeatureToMap((GeoJsonFeature) feature, map); } }
GeoJsonRenderer extends Renderer implements Observer { public void setMap(GoogleMap map) { super.setMap(map); for (Feature feature : super.getFeatures()) { redrawFeatureToMap((GeoJsonFeature) feature, map); } } }
GeoJsonRenderer extends Renderer implements Observer { public void setMap(GoogleMap map) { super.setMap(map); for (Feature feature : super.getFeatures()) { redrawFeatureToMap((GeoJsonFeature) feature, map); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Polygon...
GeoJsonRenderer extends Renderer implements Observer { public void setMap(GoogleMap map) { super.setMap(map); for (Feature feature : super.getFeatures()) { redrawFeatureToMap((GeoJsonFeature) feature, map); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Polygon...
GeoJsonRenderer extends Renderer implements Observer { public void setMap(GoogleMap map) { super.setMap(map); for (Feature feature : super.getFeatures()) { redrawFeatureToMap((GeoJsonFeature) feature, map); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Polygon...
@Test public void testPointAltitude() { KmlPoint kmlPoint = createSimplePoint(); assertNotNull(kmlPoint); assertNull(kmlPoint.getAltitude()); kmlPoint = createSimplePointWithAltitudes(); assertNotNull(kmlPoint); assertNotNull(kmlPoint.getAltitude()); assertEquals(100.0, kmlPoint.getAltitude(), 0); }
public Double getAltitude() { return mAltitude; }
KmlPoint extends Point { public Double getAltitude() { return mAltitude; } }
KmlPoint extends Point { public Double getAltitude() { return mAltitude; } KmlPoint(LatLng coordinates); KmlPoint(LatLng coordinates, Double altitude); }
KmlPoint extends Point { public Double getAltitude() { return mAltitude; } KmlPoint(LatLng coordinates); KmlPoint(LatLng coordinates, Double altitude); Double getAltitude(); }
KmlPoint extends Point { public Double getAltitude() { return mAltitude; } KmlPoint(LatLng coordinates); KmlPoint(LatLng coordinates, Double altitude); Double getAltitude(); }
@Test public void testAddFeature() { mRenderer.addFeature(mGeoJsonFeature); assertTrue(mRenderer.getFeatures().contains(mGeoJsonFeature)); }
public void addFeature(GeoJsonFeature feature) { super.addFeature(feature); if (isLayerOnMap()) { feature.addObserver(this); } }
GeoJsonRenderer extends Renderer implements Observer { public void addFeature(GeoJsonFeature feature) { super.addFeature(feature); if (isLayerOnMap()) { feature.addObserver(this); } } }
GeoJsonRenderer extends Renderer implements Observer { public void addFeature(GeoJsonFeature feature) { super.addFeature(feature); if (isLayerOnMap()) { feature.addObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, PolygonManager polygonManager, Pol...
GeoJsonRenderer extends Renderer implements Observer { public void addFeature(GeoJsonFeature feature) { super.addFeature(feature); if (isLayerOnMap()) { feature.addObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, PolygonManager polygonManager, Pol...
GeoJsonRenderer extends Renderer implements Observer { public void addFeature(GeoJsonFeature feature) { super.addFeature(feature); if (isLayerOnMap()) { feature.addObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, PolygonManager polygonManager, Pol...
@Test public void testRemoveLayerFromMap() throws Exception { mLayer = new GeoJsonLayer(mMap1, createFeatureCollection()); mRenderer.removeLayerFromMap(); assertEquals(mMap1, mRenderer.getMap()); }
public void removeLayerFromMap() { if (isLayerOnMap()) { for (Feature feature : super.getFeatures()) { removeFromMap(super.getAllFeatures().get(feature)); feature.deleteObserver(this); } setLayerVisibility(false); } }
GeoJsonRenderer extends Renderer implements Observer { public void removeLayerFromMap() { if (isLayerOnMap()) { for (Feature feature : super.getFeatures()) { removeFromMap(super.getAllFeatures().get(feature)); feature.deleteObserver(this); } setLayerVisibility(false); } } }
GeoJsonRenderer extends Renderer implements Observer { public void removeLayerFromMap() { if (isLayerOnMap()) { for (Feature feature : super.getFeatures()) { removeFromMap(super.getAllFeatures().get(feature)); feature.deleteObserver(this); } setLayerVisibility(false); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonF...
GeoJsonRenderer extends Renderer implements Observer { public void removeLayerFromMap() { if (isLayerOnMap()) { for (Feature feature : super.getFeatures()) { removeFromMap(super.getAllFeatures().get(feature)); feature.deleteObserver(this); } setLayerVisibility(false); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonF...
GeoJsonRenderer extends Renderer implements Observer { public void removeLayerFromMap() { if (isLayerOnMap()) { for (Feature feature : super.getFeatures()) { removeFromMap(super.getAllFeatures().get(feature)); feature.deleteObserver(this); } setLayerVisibility(false); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonF...
@Test public void testRemoveFeature() { mRenderer.addFeature(mGeoJsonFeature); mRenderer.removeFeature(mGeoJsonFeature); assertFalse(mRenderer.getFeatures().contains(mGeoJsonFeature)); }
public void removeFeature(GeoJsonFeature feature) { super.removeFeature(feature); if (super.getFeatures().contains(feature)) { feature.deleteObserver(this); } }
GeoJsonRenderer extends Renderer implements Observer { public void removeFeature(GeoJsonFeature feature) { super.removeFeature(feature); if (super.getFeatures().contains(feature)) { feature.deleteObserver(this); } } }
GeoJsonRenderer extends Renderer implements Observer { public void removeFeature(GeoJsonFeature feature) { super.removeFeature(feature); if (super.getFeatures().contains(feature)) { feature.deleteObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Po...
GeoJsonRenderer extends Renderer implements Observer { public void removeFeature(GeoJsonFeature feature) { super.removeFeature(feature); if (super.getFeatures().contains(feature)) { feature.deleteObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Po...
GeoJsonRenderer extends Renderer implements Observer { public void removeFeature(GeoJsonFeature feature) { super.removeFeature(feature); if (super.getFeatures().contains(feature)) { feature.deleteObserver(this); } } GeoJsonRenderer(GoogleMap map, HashMap<GeoJsonFeature, Object> features, MarkerManager markerManager, Po...
@Test public void testGetType() { List<GeoJsonPolygon> polygons = new ArrayList<>(); List<ArrayList<LatLng>> polygon = new ArrayList<>(); polygon.add( new ArrayList<>( Arrays.asList( new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0)))); polygons.add(new GeoJsonPolygon(polygon)); polygon = new A...
public String getType() { return getGeometryType(); }
GeoJsonMultiPolygon extends MultiGeometry { public String getType() { return getGeometryType(); } }
GeoJsonMultiPolygon extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPolygon(List<GeoJsonPolygon> geoJsonPolygons); }
GeoJsonMultiPolygon extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPolygon(List<GeoJsonPolygon> geoJsonPolygons); String getType(); List<GeoJsonPolygon> getPolygons(); }
GeoJsonMultiPolygon extends MultiGeometry { public String getType() { return getGeometryType(); } GeoJsonMultiPolygon(List<GeoJsonPolygon> geoJsonPolygons); String getType(); List<GeoJsonPolygon> getPolygons(); }
@Test public void testGetPolygons() { List<GeoJsonPolygon> polygons = new ArrayList<>(); List<ArrayList<LatLng>> polygon = new ArrayList<>(); polygon.add( new ArrayList<>( Arrays.asList( new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0)))); polygons.add(new GeoJsonPolygon(polygon)); polygon = n...
public List<GeoJsonPolygon> getPolygons() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPolygon> geoJsonPolygon = new ArrayList<GeoJsonPolygon>(); for (Geometry geometry : geometryList) { GeoJsonPolygon polygon = (GeoJsonPolygon) geometry; geoJsonPolygon.add(polygon); } return geoJsonPolygon; }
GeoJsonMultiPolygon extends MultiGeometry { public List<GeoJsonPolygon> getPolygons() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPolygon> geoJsonPolygon = new ArrayList<GeoJsonPolygon>(); for (Geometry geometry : geometryList) { GeoJsonPolygon polygon = (GeoJsonPolygon) geometry; geoJsonPolyg...
GeoJsonMultiPolygon extends MultiGeometry { public List<GeoJsonPolygon> getPolygons() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPolygon> geoJsonPolygon = new ArrayList<GeoJsonPolygon>(); for (Geometry geometry : geometryList) { GeoJsonPolygon polygon = (GeoJsonPolygon) geometry; geoJsonPolyg...
GeoJsonMultiPolygon extends MultiGeometry { public List<GeoJsonPolygon> getPolygons() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPolygon> geoJsonPolygon = new ArrayList<GeoJsonPolygon>(); for (Geometry geometry : geometryList) { GeoJsonPolygon polygon = (GeoJsonPolygon) geometry; geoJsonPolyg...
GeoJsonMultiPolygon extends MultiGeometry { public List<GeoJsonPolygon> getPolygons() { List<Geometry> geometryList = getGeometryObject(); ArrayList<GeoJsonPolygon> geoJsonPolygon = new ArrayList<GeoJsonPolygon>(); for (Geometry geometry : geometryList) { GeoJsonPolygon polygon = (GeoJsonPolygon) geometry; geoJsonPolyg...
@Test public void testGetGeometryType() { assertTrue(Arrays.asList(polygonStyle.getGeometryType()).contains("Polygon")); assertTrue(Arrays.asList(polygonStyle.getGeometryType()).contains("MultiPolygon")); assertTrue(Arrays.asList(polygonStyle.getGeometryType()).contains("GeometryCollection")); assertEquals(3, polygonSt...
@Override public String[] getGeometryType() { return GEOMETRY_TYPE; }
GeoJsonPolygonStyle extends Style implements GeoJsonStyle { @Override public String[] getGeometryType() { return GEOMETRY_TYPE; } }
GeoJsonPolygonStyle extends Style implements GeoJsonStyle { @Override public String[] getGeometryType() { return GEOMETRY_TYPE; } GeoJsonPolygonStyle(); }
GeoJsonPolygonStyle extends Style implements GeoJsonStyle { @Override public String[] getGeometryType() { return GEOMETRY_TYPE; } GeoJsonPolygonStyle(); @Override String[] getGeometryType(); int getFillColor(); void setFillColor(int fillColor); boolean isGeodesic(); void setGeodesic(boolean geodesic); int getStrokeColo...
GeoJsonPolygonStyle extends Style implements GeoJsonStyle { @Override public String[] getGeometryType() { return GEOMETRY_TYPE; } GeoJsonPolygonStyle(); @Override String[] getGeometryType(); int getFillColor(); void setFillColor(int fillColor); boolean isGeodesic(); void setGeodesic(boolean geodesic); int getStrokeColo...
@Test public void testGetMap() { assertEquals(mMap1, mRenderer.getMap()); }
public GoogleMap getMap() { return mMap; }
Renderer { public GoogleMap getMap() { return mMap; } }
Renderer { public GoogleMap getMap() { return mMap; } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverl...
Renderer { public GoogleMap getMap() { return mMap; } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverl...
Renderer { public GoogleMap getMap() { return mMap; } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverl...
@Test public void testGetFeatures() { assertEquals(featureSet, mRenderer.getFeatures()); }
public Set<Feature> getFeatures() { return mFeatures.keySet(); }
Renderer { public Set<Feature> getFeatures() { return mFeatures.keySet(); } }
Renderer { public Set<Feature> getFeatures() { return mFeatures.keySet(); } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOver...
Renderer { public Set<Feature> getFeatures() { return mFeatures.keySet(); } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOver...
Renderer { public Set<Feature> getFeatures() { return mFeatures.keySet(); } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOver...
@Test public void testAddFeature() { Point p = new Point(new LatLng(30, 50)); Feature feature1 = new Feature(p, null, null); mRenderer.addFeature(feature1); assertTrue(mRenderer.getFeatures().contains(feature1)); }
protected void addFeature(Feature feature) { Object mapObject = FEATURE_NOT_ON_MAP; if (feature instanceof GeoJsonFeature) { setFeatureDefaultStyles((GeoJsonFeature) feature); } if (mLayerOnMap) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.get(feature)); } if (feature.hasGeometry()) { if (feature ins...
Renderer { protected void addFeature(Feature feature) { Object mapObject = FEATURE_NOT_ON_MAP; if (feature instanceof GeoJsonFeature) { setFeatureDefaultStyles((GeoJsonFeature) feature); } if (mLayerOnMap) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.get(feature)); } if (feature.hasGeometry()) { if (...
Renderer { protected void addFeature(Feature feature) { Object mapObject = FEATURE_NOT_ON_MAP; if (feature instanceof GeoJsonFeature) { setFeatureDefaultStyles((GeoJsonFeature) feature); } if (mLayerOnMap) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.get(feature)); } if (feature.hasGeometry()) { if (...
Renderer { protected void addFeature(Feature feature) { Object mapObject = FEATURE_NOT_ON_MAP; if (feature instanceof GeoJsonFeature) { setFeatureDefaultStyles((GeoJsonFeature) feature); } if (mLayerOnMap) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.get(feature)); } if (feature.hasGeometry()) { if (...
Renderer { protected void addFeature(Feature feature) { Object mapObject = FEATURE_NOT_ON_MAP; if (feature instanceof GeoJsonFeature) { setFeatureDefaultStyles((GeoJsonFeature) feature); } if (mLayerOnMap) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.get(feature)); } if (feature.hasGeometry()) { if (...
@Test public void testRemoveFeature() { Point p = new Point(new LatLng(40, 50)); Feature feature1 = new Feature(p, null, null); mRenderer.addFeature(feature1); mRenderer.removeFeature(feature1); assertFalse(mRenderer.getFeatures().contains(feature1)); }
protected void removeFeature(Feature feature) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.remove(feature)); } }
Renderer { protected void removeFeature(Feature feature) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.remove(feature)); } } }
Renderer { protected void removeFeature(Feature feature) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.remove(feature)); } } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, ...
Renderer { protected void removeFeature(Feature feature) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.remove(feature)); } } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, ...
Renderer { protected void removeFeature(Feature feature) { if (mFeatures.containsKey(feature)) { removeFromMap(mFeatures.remove(feature)); } } Renderer(GoogleMap map, Context context, MarkerManager markerManager, PolygonManager polygonManager, ...
@Test public void testGetType() { KmlPolygon kmlPolygon = createRegularPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getGeometryType()); assertEquals("Polygon", kmlPolygon.getGeometryType()); }
public String getGeometryType() { return GEOMETRY_TYPE; }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public String getGeometryType() { return GEOMETRY_TYPE; } }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public String getGeometryType() { return GEOMETRY_TYPE; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public String getGeometryType() { return GEOMETRY_TYPE; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng>> getGeometryObject(); List<LatLng>...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public String getGeometryType() { return GEOMETRY_TYPE; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng>> getGeometryObject(); List<LatLng>...
@Test public void testGetGeometryType() { Point p = new Point(new LatLng(0, 50)); assertEquals("Point", p.getGeometryType()); }
public String getGeometryType() { return GEOMETRY_TYPE; }
Point implements Geometry { public String getGeometryType() { return GEOMETRY_TYPE; } }
Point implements Geometry { public String getGeometryType() { return GEOMETRY_TYPE; } Point(LatLng coordinates); }
Point implements Geometry { public String getGeometryType() { return GEOMETRY_TYPE; } Point(LatLng coordinates); String getGeometryType(); LatLng getGeometryObject(); @Override String toString(); }
Point implements Geometry { public String getGeometryType() { return GEOMETRY_TYPE; } Point(LatLng coordinates); String getGeometryType(); LatLng getGeometryObject(); @Override String toString(); }
@Test public void testGetGeometryObject() { Point p = new Point(new LatLng(0, 50)); assertEquals(new LatLng(0, 50), p.getGeometryObject()); try { new Point(null); fail(); } catch (IllegalArgumentException e) { assertEquals("Coordinates cannot be null", e.getMessage()); } }
public LatLng getGeometryObject() { return mCoordinates; }
Point implements Geometry { public LatLng getGeometryObject() { return mCoordinates; } }
Point implements Geometry { public LatLng getGeometryObject() { return mCoordinates; } Point(LatLng coordinates); }
Point implements Geometry { public LatLng getGeometryObject() { return mCoordinates; } Point(LatLng coordinates); String getGeometryType(); LatLng getGeometryObject(); @Override String toString(); }
Point implements Geometry { public LatLng getGeometryObject() { return mCoordinates; } Point(LatLng coordinates); String getGeometryType(); LatLng getGeometryObject(); @Override String toString(); }
@Test public void testGetId() { Feature feature = new Feature(null, "Pirate", null); assertNotNull(feature.getId()); assertEquals("Pirate", feature.getId()); feature = new Feature(null, null, null); assertNull(feature.getId()); }
public String getId() { return mId; }
Feature extends Observable { public String getId() { return mId; } }
Feature extends Observable { public String getId() { return mId; } Feature(Geometry featureGeometry, String id, Map<String, String> properties); }
Feature extends Observable { public String getId() { return mId; } Feature(Geometry featureGeometry, String id, Map<String, String> properties); Iterable<String> getPropertyKeys(); Iterable getProperties(); String getProperty(String property); String getId(); boolean hasProperty(String property); Geo...
Feature extends Observable { public String getId() { return mId; } Feature(Geometry featureGeometry, String id, Map<String, String> properties); Iterable<String> getPropertyKeys(); Iterable getProperties(); String getProperty(String property); String getId(); boolean hasProperty(String property); Geo...
@Test public void testInterpolateColor() { assertEquals(RED, Gradient.interpolateColor(RED, RED, 0.5f)); assertEquals(BLUE, Gradient.interpolateColor(BLUE, BLUE, 0.5f)); assertEquals(GREEN, Gradient.interpolateColor(GREEN, GREEN, 0.5f)); int result = Gradient.interpolateColor(RED, BLUE, 0); assertEquals(RED, result); r...
static int interpolateColor(int color1, int color2, float ratio) { int alpha = (int) ((Color.alpha(color2) - Color.alpha(color1)) * ratio + Color.alpha(color1)); float[] hsv1 = new float[3]; Color.RGBToHSV(Color.red(color1), Color.green(color1), Color.blue(color1), hsv1); float[] hsv2 = new float[3]; Color.RGBToHSV(Col...
Gradient { static int interpolateColor(int color1, int color2, float ratio) { int alpha = (int) ((Color.alpha(color2) - Color.alpha(color1)) * ratio + Color.alpha(color1)); float[] hsv1 = new float[3]; Color.RGBToHSV(Color.red(color1), Color.green(color1), Color.blue(color1), hsv1); float[] hsv2 = new float[3]; Color.R...
Gradient { static int interpolateColor(int color1, int color2, float ratio) { int alpha = (int) ((Color.alpha(color2) - Color.alpha(color1)) * ratio + Color.alpha(color1)); float[] hsv1 = new float[3]; Color.RGBToHSV(Color.red(color1), Color.green(color1), Color.blue(color1), hsv1); float[] hsv2 = new float[3]; Color.R...
Gradient { static int interpolateColor(int color1, int color2, float ratio) { int alpha = (int) ((Color.alpha(color2) - Color.alpha(color1)) * ratio + Color.alpha(color1)); float[] hsv1 = new float[3]; Color.RGBToHSV(Color.red(color1), Color.green(color1), Color.blue(color1), hsv1); float[] hsv2 = new float[3]; Color.R...
Gradient { static int interpolateColor(int color1, int color2, float ratio) { int alpha = (int) ((Color.alpha(color2) - Color.alpha(color1)) * ratio + Color.alpha(color1)); float[] hsv1 = new float[3]; Color.RGBToHSV(Color.red(color1), Color.green(color1), Color.blue(color1), hsv1); float[] hsv2 = new float[3]; Color.R...
@Test public void testMoreColorsThanColorMap() { int[] colors = {Color.argb(0, 0, 255, 0), GREEN, RED, BLUE}; float[] startPoints = {0f, 0.2f, 0.5f, 1f}; Gradient g = new Gradient(colors, startPoints, 2); int[] colorMap = g.generateColorMap(1.0); assertEquals(GREEN, colorMap[0]); assertEquals(RED, colorMap[1]); }
int[] generateColorMap(double opacity) { HashMap<Integer, ColorInterval> colorIntervals = generateColorIntervals(); int[] colorMap = new int[mColorMapSize]; ColorInterval interval = colorIntervals.get(0); int start = 0; for (int i = 0; i < mColorMapSize; i++) { if (colorIntervals.containsKey(i)) { interval = colorInter...
Gradient { int[] generateColorMap(double opacity) { HashMap<Integer, ColorInterval> colorIntervals = generateColorIntervals(); int[] colorMap = new int[mColorMapSize]; ColorInterval interval = colorIntervals.get(0); int start = 0; for (int i = 0; i < mColorMapSize; i++) { if (colorIntervals.containsKey(i)) { interval =...
Gradient { int[] generateColorMap(double opacity) { HashMap<Integer, ColorInterval> colorIntervals = generateColorIntervals(); int[] colorMap = new int[mColorMapSize]; ColorInterval interval = colorIntervals.get(0); int start = 0; for (int i = 0; i < mColorMapSize; i++) { if (colorIntervals.containsKey(i)) { interval =...
Gradient { int[] generateColorMap(double opacity) { HashMap<Integer, ColorInterval> colorIntervals = generateColorIntervals(); int[] colorMap = new int[mColorMapSize]; ColorInterval interval = colorIntervals.get(0); int start = 0; for (int i = 0; i < mColorMapSize; i++) { if (colorIntervals.containsKey(i)) { interval =...
Gradient { int[] generateColorMap(double opacity) { HashMap<Integer, ColorInterval> colorIntervals = generateColorIntervals(); int[] colorMap = new int[mColorMapSize]; ColorInterval interval = colorIntervals.get(0); int start = 0; for (int i = 0; i < mColorMapSize; i++) { if (colorIntervals.containsKey(i)) { interval =...
@Test public void testClear() { mTree.add(new Item(.1, .1)); mTree.add(new Item(.2, .2)); mTree.add(new Item(.3, .3)); mTree.clear(); Assert.assertEquals(0, searchAll().size()); }
public void clear() { mChildren = null; if (mItems != null) { mItems.clear(); } }
PointQuadTree { public void clear() { mChildren = null; if (mItems != null) { mItems.clear(); } } }
PointQuadTree { public void clear() { mChildren = null; if (mItems != null) { mItems.clear(); } } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, double maxY, int depth); private PointQuadTree(Bounds bounds,...
PointQuadTree { public void clear() { mChildren = null; if (mItems != null) { mItems.clear(); } } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, double maxY, int depth); private PointQuadTree(Bounds bounds,...
PointQuadTree { public void clear() { mChildren = null; if (mItems != null) { mItems.clear(); } } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, double maxY, int depth); private PointQuadTree(Bounds bounds,...
@Test public void testSearch() { System.gc(); for (int i = 0; i < 10000; i++) { mTree.add(new Item(i / 20000.0, i / 20000.0)); } Assert.assertEquals(10000, searchAll().size()); Assert.assertEquals( 1, mTree.search(new Bounds((double) 0, 0.00001, (double) 0, 0.00001)).size()); Assert.assertEquals(0, mTree.search(new Bou...
public Collection<T> search(Bounds searchBounds) { final List<T> results = new ArrayList<T>(); search(searchBounds, results); return results; }
PointQuadTree { public Collection<T> search(Bounds searchBounds) { final List<T> results = new ArrayList<T>(); search(searchBounds, results); return results; } }
PointQuadTree { public Collection<T> search(Bounds searchBounds) { final List<T> results = new ArrayList<T>(); search(searchBounds, results); return results; } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, ...
PointQuadTree { public Collection<T> search(Bounds searchBounds) { final List<T> results = new ArrayList<T>(); search(searchBounds, results); return results; } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, ...
PointQuadTree { public Collection<T> search(Bounds searchBounds) { final List<T> results = new ArrayList<T>(); search(searchBounds, results); return results; } PointQuadTree(double minX, double maxX, double minY, double maxY); PointQuadTree(Bounds bounds); private PointQuadTree(double minX, double maxX, double minY, ...
@Test public void testAngles() { assertEquals(SphericalUtil.computeAngleBetween(up, up), 0, 1e-6); assertEquals(SphericalUtil.computeAngleBetween(down, down), 0, 1e-6); assertEquals(SphericalUtil.computeAngleBetween(left, left), 0, 1e-6); assertEquals(SphericalUtil.computeAngleBetween(right, right), 0, 1e-6); assertEqu...
static double computeAngleBetween(LatLng from, LatLng to) { return distanceRadians(toRadians(from.latitude), toRadians(from.longitude), toRadians(to.latitude), toRadians(to.longitude)); }
SphericalUtil { static double computeAngleBetween(LatLng from, LatLng to) { return distanceRadians(toRadians(from.latitude), toRadians(from.longitude), toRadians(to.latitude), toRadians(to.longitude)); } }
SphericalUtil { static double computeAngleBetween(LatLng from, LatLng to) { return distanceRadians(toRadians(from.latitude), toRadians(from.longitude), toRadians(to.latitude), toRadians(to.longitude)); } private SphericalUtil(); }
SphericalUtil { static double computeAngleBetween(LatLng from, LatLng to) { return distanceRadians(toRadians(from.latitude), toRadians(from.longitude), toRadians(to.latitude), toRadians(to.longitude)); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng f...
SphericalUtil { static double computeAngleBetween(LatLng from, LatLng to) { return distanceRadians(toRadians(from.latitude), toRadians(from.longitude), toRadians(to.latitude), toRadians(to.longitude)); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng f...
@Test public void testDistances() { assertEquals(SphericalUtil.computeDistanceBetween(up, down), Math.PI * EARTH_RADIUS, 1e-6); }
public static double computeDistanceBetween(LatLng from, LatLng to) { return computeAngleBetween(from, to) * EARTH_RADIUS; }
SphericalUtil { public static double computeDistanceBetween(LatLng from, LatLng to) { return computeAngleBetween(from, to) * EARTH_RADIUS; } }
SphericalUtil { public static double computeDistanceBetween(LatLng from, LatLng to) { return computeAngleBetween(from, to) * EARTH_RADIUS; } private SphericalUtil(); }
SphericalUtil { public static double computeDistanceBetween(LatLng from, LatLng to) { return computeAngleBetween(from, to) * EARTH_RADIUS; } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOff...
SphericalUtil { public static double computeDistanceBetween(LatLng from, LatLng to) { return computeAngleBetween(from, to) * EARTH_RADIUS; } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOff...
@Test public void testHeadings() { assertEquals(SphericalUtil.computeHeading(up, down), -180, 1e-6); assertEquals(SphericalUtil.computeHeading(down, up), 0, 1e-6); assertEquals(SphericalUtil.computeHeading(front, up), 0, 1e-6); assertEquals(SphericalUtil.computeHeading(right, up), 0, 1e-6); assertEquals(SphericalUtil.c...
public static double computeHeading(LatLng from, LatLng to) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double dLng = toLng - fromLng; double heading = atan2( sin(dLng) * cos(toLat), cos(fromLat) ...
SphericalUtil { public static double computeHeading(LatLng from, LatLng to) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double dLng = toLng - fromLng; double heading = atan2( sin(dLng) * cos(toLat...
SphericalUtil { public static double computeHeading(LatLng from, LatLng to) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double dLng = toLng - fromLng; double heading = atan2( sin(dLng) * cos(toLat...
SphericalUtil { public static double computeHeading(LatLng from, LatLng to) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double dLng = toLng - fromLng; double heading = atan2( sin(dLng) * cos(toLat...
SphericalUtil { public static double computeHeading(LatLng from, LatLng to) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double dLng = toLng - fromLng; double heading = atan2( sin(dLng) * cos(toLat...
@Test public void testGetOuterBoundaryCoordinates() { KmlPolygon kmlPolygon = createRegularPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getOuterBoundaryCoordinates()); kmlPolygon = createOuterPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getOuterBoundaryCoordinates()); }
public List<LatLng> getOuterBoundaryCoordinates() { return mOuterBoundaryCoordinates; }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<LatLng> getOuterBoundaryCoordinates() { return mOuterBoundaryCoordinates; } }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<LatLng> getOuterBoundaryCoordinates() { return mOuterBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<LatLng> getOuterBoundaryCoordinates() { return mOuterBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng>> get...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<LatLng> getOuterBoundaryCoordinates() { return mOuterBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng>> get...
@Test public void testComputeOffset() { expectLatLngApproxEquals(front, SphericalUtil.computeOffset(front, 0, 0)); expectLatLngApproxEquals( up, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, 0)); expectLatLngApproxEquals( down, SphericalUtil.computeOffset(front, Math.PI * EARTH_RADIUS / 2, 180)); expec...
public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double sinFromLat = si...
SphericalUtil { public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double...
SphericalUtil { public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double...
SphericalUtil { public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double...
SphericalUtil { public static LatLng computeOffset(LatLng from, double distance, double heading) { distance /= EARTH_RADIUS; heading = toRadians(heading); double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double cosDistance = cos(distance); double sinDistance = sin(distance); double...
@Test public void testComputeOffsetOrigin() { expectLatLngApproxEquals(front, SphericalUtil.computeOffsetOrigin(front, 0, 0)); expectLatLngApproxEquals( front, SphericalUtil.computeOffsetOrigin( new LatLng(0, 45), Math.PI * EARTH_RADIUS / 4, 90)); expectLatLngApproxEquals( front, SphericalUtil.computeOffsetOrigin( new ...
public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; double n1 = cos(distance); double n2 = sin(distance) * cos(heading); double n3 = sin(distance) * sin(heading); double n4 = sin(toRadians(to.latitude)); double n12 = n1 * n1; dou...
SphericalUtil { public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; double n1 = cos(distance); double n2 = sin(distance) * cos(heading); double n3 = sin(distance) * sin(heading); double n4 = sin(toRadians(to.latitude)); double n1...
SphericalUtil { public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; double n1 = cos(distance); double n2 = sin(distance) * cos(heading); double n3 = sin(distance) * sin(heading); double n4 = sin(toRadians(to.latitude)); double n1...
SphericalUtil { public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; double n1 = cos(distance); double n2 = sin(distance) * cos(heading); double n3 = sin(distance) * sin(heading); double n4 = sin(toRadians(to.latitude)); double n1...
SphericalUtil { public static LatLng computeOffsetOrigin(LatLng to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; double n1 = cos(distance); double n2 = sin(distance) * cos(heading); double n3 = sin(distance) * sin(heading); double n4 = sin(toRadians(to.latitude)); double n1...
@Test public void testInterpolate() { expectLatLngApproxEquals(up, SphericalUtil.interpolate(up, up, 1 / 2.0)); expectLatLngApproxEquals(down, SphericalUtil.interpolate(down, down, 1 / 2.0)); expectLatLngApproxEquals(left, SphericalUtil.interpolate(left, left, 1 / 2.0)); expectLatLngApproxEquals(new LatLng(1, 0), Spher...
public static LatLng interpolate(LatLng from, LatLng to, double fraction) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double cosFromLat = cos(fromLat); double cosToLat = cos(toLat); double angle =...
SphericalUtil { public static LatLng interpolate(LatLng from, LatLng to, double fraction) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double cosFromLat = cos(fromLat); double cosToLat = cos(toLat)...
SphericalUtil { public static LatLng interpolate(LatLng from, LatLng to, double fraction) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double cosFromLat = cos(fromLat); double cosToLat = cos(toLat)...
SphericalUtil { public static LatLng interpolate(LatLng from, LatLng to, double fraction) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double cosFromLat = cos(fromLat); double cosToLat = cos(toLat)...
SphericalUtil { public static LatLng interpolate(LatLng from, LatLng to, double fraction) { double fromLat = toRadians(from.latitude); double fromLng = toRadians(from.longitude); double toLat = toRadians(to.latitude); double toLng = toRadians(to.longitude); double cosFromLat = cos(fromLat); double cosToLat = cos(toLat)...
@Test public void testComputeLength() { List<LatLng> latLngs; assertEquals(SphericalUtil.computeLength(Collections.<LatLng>emptyList()), 0, 1e-6); assertEquals(SphericalUtil.computeLength(Arrays.asList(new LatLng(0, 0))), 0, 1e-6); latLngs = Arrays.asList(new LatLng(0, 0), new LatLng(0.1, 0.1)); assertEquals( Spherical...
public static double computeLength(List<LatLng> path) { if (path.size() < 2) { return 0; } double length = 0; LatLng prev = path.get(0); double prevLat = toRadians(prev.latitude); double prevLng = toRadians(prev.longitude); for (LatLng point : path) { double lat = toRadians(point.latitude); double lng = toRadians(point...
SphericalUtil { public static double computeLength(List<LatLng> path) { if (path.size() < 2) { return 0; } double length = 0; LatLng prev = path.get(0); double prevLat = toRadians(prev.latitude); double prevLng = toRadians(prev.longitude); for (LatLng point : path) { double lat = toRadians(point.latitude); double lng =...
SphericalUtil { public static double computeLength(List<LatLng> path) { if (path.size() < 2) { return 0; } double length = 0; LatLng prev = path.get(0); double prevLat = toRadians(prev.latitude); double prevLng = toRadians(prev.longitude); for (LatLng point : path) { double lat = toRadians(point.latitude); double lng =...
SphericalUtil { public static double computeLength(List<LatLng> path) { if (path.size() < 2) { return 0; } double length = 0; LatLng prev = path.get(0); double prevLat = toRadians(prev.latitude); double prevLng = toRadians(prev.longitude); for (LatLng point : path) { double lat = toRadians(point.latitude); double lng =...
SphericalUtil { public static double computeLength(List<LatLng> path) { if (path.size() < 2) { return 0; } double length = 0; LatLng prev = path.get(0); double prevLat = toRadians(prev.latitude); double prevLng = toRadians(prev.longitude); for (LatLng point : path) { double lat = toRadians(point.latitude); double lng =...
@Test public void testComputeArea() { assertEquals( SphericalUtil.computeArea(Arrays.asList(right, up, front, down, right)), Math.PI * EARTH_RADIUS * EARTH_RADIUS, .4); assertEquals( SphericalUtil.computeArea(Arrays.asList(right, down, front, up, right)), Math.PI * EARTH_RADIUS * EARTH_RADIUS, .4); }
public static double computeArea(List<LatLng> path) { return abs(computeSignedArea(path)); }
SphericalUtil { public static double computeArea(List<LatLng> path) { return abs(computeSignedArea(path)); } }
SphericalUtil { public static double computeArea(List<LatLng> path) { return abs(computeSignedArea(path)); } private SphericalUtil(); }
SphericalUtil { public static double computeArea(List<LatLng> path) { return abs(computeSignedArea(path)); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOffsetOrigin(LatLng to, double dist...
SphericalUtil { public static double computeArea(List<LatLng> path) { return abs(computeSignedArea(path)); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOffsetOrigin(LatLng to, double dist...
@Test public void testComputeSignedArea() { List<LatLng> path = Arrays.asList(right, up, front, down, right); List<LatLng> pathReversed = Arrays.asList(right, down, front, up, right); assertEquals( -SphericalUtil.computeSignedArea(path), SphericalUtil.computeSignedArea(pathReversed), 0); }
public static double computeSignedArea(List<LatLng> path) { return computeSignedArea(path, EARTH_RADIUS); }
SphericalUtil { public static double computeSignedArea(List<LatLng> path) { return computeSignedArea(path, EARTH_RADIUS); } }
SphericalUtil { public static double computeSignedArea(List<LatLng> path) { return computeSignedArea(path, EARTH_RADIUS); } private SphericalUtil(); }
SphericalUtil { public static double computeSignedArea(List<LatLng> path) { return computeSignedArea(path, EARTH_RADIUS); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOffsetOrigin(LatLng ...
SphericalUtil { public static double computeSignedArea(List<LatLng> path) { return computeSignedArea(path, EARTH_RADIUS); } private SphericalUtil(); static double computeHeading(LatLng from, LatLng to); static LatLng computeOffset(LatLng from, double distance, double heading); static LatLng computeOffsetOrigin(LatLng ...
@Test public void testContainsLocation() { containsCase(makeList(), makeList(), makeList(0, 0)); containsCase(makeList(1, 2), makeList(1, 2), makeList(0, 0)); containsCase(makeList(1, 2, 3, 5), makeList(1, 2, 3, 5), makeList(0, 0, 40, 4)); containsCase( makeList(0., 0., 10., 12., 20., 5.), makeList(10., 12., 10, 11, 19...
public static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic) { return containsLocation(point.latitude, point.longitude, polygon, geodesic); }
PolyUtil { public static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic) { return containsLocation(point.latitude, point.longitude, polygon, geodesic); } }
PolyUtil { public static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic) { return containsLocation(point.latitude, point.longitude, polygon, geodesic); } private PolyUtil(); }
PolyUtil { public static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic) { return containsLocation(point.latitude, point.longitude, polygon, geodesic); } private PolyUtil(); static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic); static boolean containsLoca...
PolyUtil { public static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic) { return containsLocation(point.latitude, point.longitude, polygon, geodesic); } private PolyUtil(); static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic); static boolean containsLoca...
@Test public void testSimplify() { final String LINE = "elfjD~a}uNOnFN~Em@fJv@tEMhGDjDe@hG^nF??@lA?n@IvAC`Ay@A{@DwCA{CF_EC{CEi@PBTFDJBJ?V?n@?D@?A@?@?F?F?LAf@?n@@`@@T@~@FpA?fA?p@?r@?vAH`@OR@^ETFJCLD?JA^?J?P?fAC`B@d@?b@A\\@`@Ad@@\\?`@?f@?V?H?DD@DDBBDBD?D?B?B@B@@@B@B@B@D?D?JAF@H@FCLADBDBDCFAN?b@Af@@x@@"; List<LatLng> line...
public static List<LatLng> simplify(List<LatLng> poly, double tolerance) { final int n = poly.size(); if (n < 1) { throw new IllegalArgumentException("Polyline must have at least 1 point"); } if (tolerance <= 0) { throw new IllegalArgumentException("Tolerance must be greater than zero"); } boolean closedPolygon = isClo...
PolyUtil { public static List<LatLng> simplify(List<LatLng> poly, double tolerance) { final int n = poly.size(); if (n < 1) { throw new IllegalArgumentException("Polyline must have at least 1 point"); } if (tolerance <= 0) { throw new IllegalArgumentException("Tolerance must be greater than zero"); } boolean closedPoly...
PolyUtil { public static List<LatLng> simplify(List<LatLng> poly, double tolerance) { final int n = poly.size(); if (n < 1) { throw new IllegalArgumentException("Polyline must have at least 1 point"); } if (tolerance <= 0) { throw new IllegalArgumentException("Tolerance must be greater than zero"); } boolean closedPoly...
PolyUtil { public static List<LatLng> simplify(List<LatLng> poly, double tolerance) { final int n = poly.size(); if (n < 1) { throw new IllegalArgumentException("Polyline must have at least 1 point"); } if (tolerance <= 0) { throw new IllegalArgumentException("Tolerance must be greater than zero"); } boolean closedPoly...
PolyUtil { public static List<LatLng> simplify(List<LatLng> poly, double tolerance) { final int n = poly.size(); if (n < 1) { throw new IllegalArgumentException("Polyline must have at least 1 point"); } if (tolerance <= 0) { throw new IllegalArgumentException("Tolerance must be greater than zero"); } boolean closedPoly...
@Test public void testIsClosedPolygon() { ArrayList<LatLng> poly = new ArrayList<>(); poly.add(new LatLng(28.06025, -82.41030)); poly.add(new LatLng(28.06129, -82.40945)); poly.add(new LatLng(28.06206, -82.40917)); poly.add(new LatLng(28.06125, -82.40850)); poly.add(new LatLng(28.06035, -82.40834)); assertFalse(PolyUti...
public static boolean isClosedPolygon(List<LatLng> poly) { LatLng firstPoint = poly.get(0); LatLng lastPoint = poly.get(poly.size() - 1); return firstPoint.equals(lastPoint); }
PolyUtil { public static boolean isClosedPolygon(List<LatLng> poly) { LatLng firstPoint = poly.get(0); LatLng lastPoint = poly.get(poly.size() - 1); return firstPoint.equals(lastPoint); } }
PolyUtil { public static boolean isClosedPolygon(List<LatLng> poly) { LatLng firstPoint = poly.get(0); LatLng lastPoint = poly.get(poly.size() - 1); return firstPoint.equals(lastPoint); } private PolyUtil(); }
PolyUtil { public static boolean isClosedPolygon(List<LatLng> poly) { LatLng firstPoint = poly.get(0); LatLng lastPoint = poly.get(poly.size() - 1); return firstPoint.equals(lastPoint); } private PolyUtil(); static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic); static boolean containsL...
PolyUtil { public static boolean isClosedPolygon(List<LatLng> poly) { LatLng firstPoint = poly.get(0); LatLng lastPoint = poly.get(poly.size() - 1); return firstPoint.equals(lastPoint); } private PolyUtil(); static boolean containsLocation(LatLng point, List<LatLng> polygon, boolean geodesic); static boolean containsL...
@Test public void testDistanceToLine() { LatLng startLine = new LatLng(28.05359, -82.41632); LatLng endLine = new LatLng(28.05310, -82.41634); LatLng p = new LatLng(28.05342, -82.41594); double distance = PolyUtil.distanceToLine(p, startLine, endLine); assertEquals(37.947946, distance, 1e-6); }
public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s1lng = toRa...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
@Test public void testGetInnerBoundaryCoordinates() { KmlPolygon kmlPolygon = createRegularPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getInnerBoundaryCoordinates()); kmlPolygon = createOuterPolygon(); assertNotNull(kmlPolygon); assertNull(kmlPolygon.getInnerBoundaryCoordinates()); }
public List<List<LatLng>> getInnerBoundaryCoordinates() { return mInnerBoundaryCoordinates; }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getInnerBoundaryCoordinates() { return mInnerBoundaryCoordinates; } }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getInnerBoundaryCoordinates() { return mInnerBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getInnerBoundaryCoordinates() { return mInnerBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getInnerBoundaryCoordinates() { return mInnerBoundaryCoordinates; } KmlPolygon(List<LatLng> outerBoundaryCoordinates, List<List<LatLng>> innerBoundaryCoordinates); String getGeometryType(); List<List<LatLng...
@Test public void testDistanceToLineLessThanDistanceToExtrems() { LatLng startLine = new LatLng(28.05359, -82.41632); LatLng endLine = new LatLng(28.05310, -82.41634); LatLng p = new LatLng(28.05342, -82.41594); double distance = PolyUtil.distanceToLine(p, startLine, endLine); double distanceToStart = SphericalUtil.com...
public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s1lng = toRa...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
PolyUtil { public static double distanceToLine(final LatLng p, final LatLng start, final LatLng end) { if (start.equals(end)) { return computeDistanceBetween(end, p); } final double s0lat = toRadians(p.latitude); final double s0lng = toRadians(p.longitude); final double s1lat = toRadians(start.latitude); final double s...
@Test public void testDecodePath() { List<LatLng> latLngs = PolyUtil.decode(TEST_LINE); int expectedLength = 21; assertEquals("Wrong length.", expectedLength, latLngs.size()); LatLng lastPoint = latLngs.get(expectedLength - 1); assertEquals(37.76953, lastPoint.latitude, 1e-6); assertEquals(-122.41488, lastPoint.longitu...
public static List<LatLng> decode(final String encodedPath) { int len = encodedPath.length(); final List<LatLng> path = new ArrayList<LatLng>(); int index = 0; int lat = 0; int lng = 0; while (index < len) { int result = 1; int shift = 0; int b; do { b = encodedPath.charAt(index++) - 63 - 1; result += b << shift; shift...
PolyUtil { public static List<LatLng> decode(final String encodedPath) { int len = encodedPath.length(); final List<LatLng> path = new ArrayList<LatLng>(); int index = 0; int lat = 0; int lng = 0; while (index < len) { int result = 1; int shift = 0; int b; do { b = encodedPath.charAt(index++) - 63 - 1; result += b << s...
PolyUtil { public static List<LatLng> decode(final String encodedPath) { int len = encodedPath.length(); final List<LatLng> path = new ArrayList<LatLng>(); int index = 0; int lat = 0; int lng = 0; while (index < len) { int result = 1; int shift = 0; int b; do { b = encodedPath.charAt(index++) - 63 - 1; result += b << s...
PolyUtil { public static List<LatLng> decode(final String encodedPath) { int len = encodedPath.length(); final List<LatLng> path = new ArrayList<LatLng>(); int index = 0; int lat = 0; int lng = 0; while (index < len) { int result = 1; int shift = 0; int b; do { b = encodedPath.charAt(index++) - 63 - 1; result += b << s...
PolyUtil { public static List<LatLng> decode(final String encodedPath) { int len = encodedPath.length(); final List<LatLng> path = new ArrayList<LatLng>(); int index = 0; int lat = 0; int lng = 0; while (index < len) { int result = 1; int shift = 0; int b; do { b = encodedPath.charAt(index++) - 63 - 1; result += b << s...
@Test public void testGetKmlGeometryObject() { KmlPolygon kmlPolygon = createRegularPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getGeometryObject()); assertEquals(2, kmlPolygon.getGeometryObject().size()); kmlPolygon = createOuterPolygon(); assertNotNull(kmlPolygon); assertNotNull(kmlPolygon.getGeome...
public List<List<LatLng>> getGeometryObject() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add(mOuterBoundaryCoordinates); if (mInnerBoundaryCoordinates != null) { coordinates.addAll(mInnerBoundaryCoordinates); } return coordinates; }
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getGeometryObject() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add(mOuterBoundaryCoordinates); if (mInnerBoundaryCoordinates != null) { coordinates.addAll(mInnerBoundaryCoordinates); } return coordinates; ...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getGeometryObject() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add(mOuterBoundaryCoordinates); if (mInnerBoundaryCoordinates != null) { coordinates.addAll(mInnerBoundaryCoordinates); } return coordinates; ...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getGeometryObject() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add(mOuterBoundaryCoordinates); if (mInnerBoundaryCoordinates != null) { coordinates.addAll(mInnerBoundaryCoordinates); } return coordinates; ...
KmlPolygon implements DataPolygon<ArrayList<ArrayList<LatLng>>> { public List<List<LatLng>> getGeometryObject() { List<List<LatLng>> coordinates = new ArrayList<>(); coordinates.add(mOuterBoundaryCoordinates); if (mInnerBoundaryCoordinates != null) { coordinates.addAll(mInnerBoundaryCoordinates); } return coordinates; ...
@Test public void testCDataEntity() throws Exception { XmlPullParser xmlPullParser = createParser("amu_cdata.kml"); KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser); assertEquals("TELEPORT", kmlContainer.getProperty("description")); }
static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); }
KmlContainerParser { static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); } }
KmlContainerParser { static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); } }
KmlContainerParser { static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); } }
KmlContainerParser { static KmlContainer createContainer(XmlPullParser parser) throws XmlPullParserException, IOException { return assignPropertiesToContainer(parser); } }
@Test public void testSetFirst() throws Exception { List<ExternalTaskExecutionInfo> tasks = ContainerUtilRt.newArrayList(); for (int i = 0; i <= ExternalSystemConstants.RECENT_TASKS_NUMBER; i++) { new ExternalTaskExecutionInfo(new ExternalSystemTaskExecutionSettings(), "task" + i); } myModel.setTasks(tasks); myModel.se...
@SuppressWarnings("unchecked") public void setFirst(@Nonnull ExternalTaskExecutionInfo task) { insertElementAt(task, 0); for (int i = 1; i < size(); i++) { if (task.equals(getElementAt(i))) { remove(i); break; } } ensureSize(ExternalSystemConstants.RECENT_TASKS_NUMBER); }
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void setFirst(@Nonnull ExternalTaskExecutionInfo task) { insertElementAt(task, 0); for (int i = 1; i < size(); i++) { if (task.equals(getElementAt(i))) { remove(i); break; } } ensureSize(ExternalSystemConstants.RECENT_TAS...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void setFirst(@Nonnull ExternalTaskExecutionInfo task) { insertElementAt(task, 0); for (int i = 1; i < size(); i++) { if (task.equals(getElementAt(i))) { remove(i); break; } } ensureSize(ExternalSystemConstants.RECENT_TAS...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void setFirst(@Nonnull ExternalTaskExecutionInfo task) { insertElementAt(task, 0); for (int i = 1; i < size(); i++) { if (task.equals(getElementAt(i))) { remove(i); break; } } ensureSize(ExternalSystemConstants.RECENT_TAS...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void setFirst(@Nonnull ExternalTaskExecutionInfo task) { insertElementAt(task, 0); for (int i = 1; i < size(); i++) { if (task.equals(getElementAt(i))) { remove(i); break; } } ensureSize(ExternalSystemConstants.RECENT_TAS...
@Test public void testEnsureSize() throws Exception { List<ExternalTaskExecutionInfo> tasks = ContainerUtilRt.newArrayList(); myModel.setTasks(tasks); myModel.ensureSize(ExternalSystemConstants.RECENT_TASKS_NUMBER); Assert.assertEquals("task list widening failed", ExternalSystemConstants.RECENT_TASKS_NUMBER, myModel.ge...
@SuppressWarnings("unchecked") public void ensureSize(int elementsNumber) { int toAdd = elementsNumber - size(); if (toAdd == 0) { return; } if(toAdd < 0) { removeRange(elementsNumber, size() - 1); } while (--toAdd >= 0) { addElement(new MyEmptyDescriptor()); } }
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void ensureSize(int elementsNumber) { int toAdd = elementsNumber - size(); if (toAdd == 0) { return; } if(toAdd < 0) { removeRange(elementsNumber, size() - 1); } while (--toAdd >= 0) { addElement(new MyEmptyDescriptor());...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void ensureSize(int elementsNumber) { int toAdd = elementsNumber - size(); if (toAdd == 0) { return; } if(toAdd < 0) { removeRange(elementsNumber, size() - 1); } while (--toAdd >= 0) { addElement(new MyEmptyDescriptor());...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void ensureSize(int elementsNumber) { int toAdd = elementsNumber - size(); if (toAdd == 0) { return; } if(toAdd < 0) { removeRange(elementsNumber, size() - 1); } while (--toAdd >= 0) { addElement(new MyEmptyDescriptor());...
ExternalSystemRecentTaskListModel extends DefaultListModel { @SuppressWarnings("unchecked") public void ensureSize(int elementsNumber) { int toAdd = elementsNumber - size(); if (toAdd == 0) { return; } if(toAdd < 0) { removeRange(elementsNumber, size() - 1); } while (--toAdd >= 0) { addElement(new MyEmptyDescriptor());...
@Test public void joinTest() { List<? extends TimedVcsCommit> first = log("6|-a2|-a0", "3|-a1|-a0", "1|-a0|-"); List<? extends TimedVcsCommit> second = log("4|-b1|-b0", "2|-b0|-"); List<? extends TimedVcsCommit> third = log("7|-c1|-c0", "5|-c0|-"); List<TimedVcsCommit> expected = log("7|-c1|-c0", "6|-a2|-a0", "5|-c0|-"...
@Nonnull public List<Commit> join(@Nonnull Collection<List<Commit>> logsFromRepos) { if (logsFromRepos.size() == 1) { return logsFromRepos.iterator().next(); } int size = 0; for (List<Commit> repo : logsFromRepos) { size += repo.size(); } List<Commit> result = new ArrayList<>(size); Map<Commit, Iterator<Commit>> nextCo...
VcsLogMultiRepoJoiner { @Nonnull public List<Commit> join(@Nonnull Collection<List<Commit>> logsFromRepos) { if (logsFromRepos.size() == 1) { return logsFromRepos.iterator().next(); } int size = 0; for (List<Commit> repo : logsFromRepos) { size += repo.size(); } List<Commit> result = new ArrayList<>(size); Map<Commit, ...
VcsLogMultiRepoJoiner { @Nonnull public List<Commit> join(@Nonnull Collection<List<Commit>> logsFromRepos) { if (logsFromRepos.size() == 1) { return logsFromRepos.iterator().next(); } int size = 0; for (List<Commit> repo : logsFromRepos) { size += repo.size(); } List<Commit> result = new ArrayList<>(size); Map<Commit, ...
VcsLogMultiRepoJoiner { @Nonnull public List<Commit> join(@Nonnull Collection<List<Commit>> logsFromRepos) { if (logsFromRepos.size() == 1) { return logsFromRepos.iterator().next(); } int size = 0; for (List<Commit> repo : logsFromRepos) { size += repo.size(); } List<Commit> result = new ArrayList<>(size); Map<Commit, ...
VcsLogMultiRepoJoiner { @Nonnull public List<Commit> join(@Nonnull Collection<List<Commit>> logsFromRepos) { if (logsFromRepos.size() == 1) { return logsFromRepos.iterator().next(); } int size = 0; for (List<Commit> repo : logsFromRepos) { size += repo.size(); } List<Commit> result = new ArrayList<>(size); Map<Commit, ...
@Test public void conditionsOrder() { ArrangementCompositeMatchCondition condition = new ArrangementCompositeMatchCondition(); ArrangementSettingsToken typeToPreserve = FIELD; Set<ArrangementSettingsToken> modifiersToPreserve = ContainerUtilRt.newHashSet(PUBLIC, STATIC, FINAL); condition.addOperand(new ArrangementAtomM...
@SuppressWarnings("MethodMayBeStatic") @javax.annotation.Nullable public <T extends ArrangementEntryMatcher> Element serialize(@Nonnull T matcher) { if (matcher instanceof StdArrangementEntryMatcher) { return serialize(((StdArrangementEntryMatcher)matcher).getCondition()); } LOG.warn(String.format( "Can't serialize arr...
DefaultArrangementEntryMatcherSerializer { @SuppressWarnings("MethodMayBeStatic") @javax.annotation.Nullable public <T extends ArrangementEntryMatcher> Element serialize(@Nonnull T matcher) { if (matcher instanceof StdArrangementEntryMatcher) { return serialize(((StdArrangementEntryMatcher)matcher).getCondition()); } L...
DefaultArrangementEntryMatcherSerializer { @SuppressWarnings("MethodMayBeStatic") @javax.annotation.Nullable public <T extends ArrangementEntryMatcher> Element serialize(@Nonnull T matcher) { if (matcher instanceof StdArrangementEntryMatcher) { return serialize(((StdArrangementEntryMatcher)matcher).getCondition()); } L...
DefaultArrangementEntryMatcherSerializer { @SuppressWarnings("MethodMayBeStatic") @javax.annotation.Nullable public <T extends ArrangementEntryMatcher> Element serialize(@Nonnull T matcher) { if (matcher instanceof StdArrangementEntryMatcher) { return serialize(((StdArrangementEntryMatcher)matcher).getCondition()); } L...
DefaultArrangementEntryMatcherSerializer { @SuppressWarnings("MethodMayBeStatic") @javax.annotation.Nullable public <T extends ArrangementEntryMatcher> Element serialize(@Nonnull T matcher) { if (matcher instanceof StdArrangementEntryMatcher) { return serialize(((StdArrangementEntryMatcher)matcher).getCondition()); } L...
@Test public void isMaxStrategyworks() throws Exception { rxDownloader = builder .strategy(DownloadStrategy.MAX) .addFile("http: .build(); List<FileContainer> res = rxDownloader.asList().blockingGet(); res.forEach(fileContainer -> { Log.i("RxDownloader", "key" + fileContainer.getFilename() + ",value " + fileContainer.g...
public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDER == DownloadSt...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
@Test public void isAllStrategyworks() throws Exception { rxDownloader = builder .strategy(DownloadStrategy.ALL) .addFile("http: .build(); List<FileContainer> res = rxDownloader.asList().blockingGet(); Assert.assertEquals(res.size(), 0); }
public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDER == DownloadSt...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
RxDownloader { public Single<List<FileContainer>> asList() { this.subject.subscribe(this.itemsObserver); this.size = this.files.size(); this.remains = this.size; Observable<FileContainer> observable = Observable .fromIterable(this.files) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()); if (ORDE...
@Test public void shouldAllPositive() throws Exception { Utils.shouldAllPositive(1, 2, 3, 4); }
public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
@Test public void getCommand3() throws Exception { Command command = commandFactory.getCommand("C 20 4"); Assert.assertThat(command, CoreMatchers.instanceOf(CreateCommand.class)); }
public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.length); switch (mainC...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
@Test public void getCommand4() throws Exception { Command command = commandFactory.getCommand("L 1 2 1 22"); Assert.assertThat(command, CoreMatchers.instanceOf(DrawLineCommand.class)); }
public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.length); switch (mainC...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
@Test public void getCommand5() throws Exception { Command command = commandFactory.getCommand("R 14 1 18 3"); Assert.assertThat(command, CoreMatchers.instanceOf(DrawRectangleCommand.class)); }
public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.length); switch (mainC...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
@Test public void getCommand6() throws Exception { Command command = commandFactory.getCommand("B 1 3 o"); Assert.assertThat(command, CoreMatchers.instanceOf(BucketFillCommand.class)); }
public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.length); switch (mainC...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
@Test(expected = IllegalArgumentException.class) public void shouldAllPositive2() throws Exception { Utils.shouldAllPositive(1, -2, 3, 4); }
public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
@Test(expected = IllegalArgumentException.class) public void shouldAllPositive3() throws Exception { Utils.shouldAllPositive(1, 2, 0, 4); }
public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
@Test public void shouldAllNonNegative2() throws Exception { Utils.shouldAllPositive(1, 2, 3, 4); }
public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
@Test(expected = IllegalArgumentException.class) public void shouldAllNonNegative3() throws Exception { Utils.shouldAllPositive(1, -2, 3, 4); }
public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
Utils { public static void shouldAllPositive(int... numbers) { for (int num : numbers) { if (num < 1) { throw new IllegalArgumentException("Number should be > 0"); } } } static int toPositiveInt(String input); static void shouldAllPositive(int... numbers); static void shouldAllNonNegative(int... numbers); }
@Test public void getEntity_DrawLineCommand() throws Exception { DrawLineCommand drawLineCommand = new DrawLineCommand( "1", "2", "1", "4"); assertEquals(entityFactory.getEntity(drawLineCommand), new Line(1, 2, 1, 4)); }
public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRectangleCommand) com...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
@Test public void getEntity_DrawRectangleCommand() throws Exception { DrawRectangleCommand drawLineCommand = new DrawRectangleCommand( "1", "2", "3", "4"); assertEquals(entityFactory.getEntity(drawLineCommand), new Rectangle(1, 2, 3, 4)); }
public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRectangleCommand) com...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
@Test public void getEntity_BucketFillCommand() throws Exception { BucketFillCommand drawLineCommand = new BucketFillCommand( "2", "3", "o"); assertEquals(entityFactory.getEntity(drawLineCommand), new BucketFill(2, 3, 'o')); }
public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRectangleCommand) com...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
@Test public void getEntity_null() throws Exception { assertEquals(entityFactory.getEntity(null), null); }
public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRectangleCommand) com...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
EntityFactory { public Entity getEntity(DrawEntityCommand command) { if (command instanceof DrawLineCommand) { DrawLineCommand cmd = (DrawLineCommand) command; return new Line(cmd.getX1(), cmd.getY1(), cmd.getX2(), cmd.getY2()); } else if (command instanceof DrawRectangleCommand) { DrawRectangleCommand cmd = (DrawRecta...
@Test public void getCommand() throws Exception { commandFactory.getCommand("Q"); }
public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.length); switch (mainC...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
CommandFactory { public Command getCommand(String commandLine) throws InvalidCommandException, InvalidCommandParams { commandLine = commandLine.trim().replaceAll(" {2}", " "); String[] split = commandLine.split(" "); String mainCommand = split[0].toUpperCase(); String[] params = Arrays.copyOfRange(split, 1, split.lengt...
@Test public void shouldSuccessfullyConvertBytesToShort() { final short value = 24; byte[] bytes = IEXByteTestUtil.convert(value); assertThat(IEXByteConverter.convertBytesToShort(bytes)).isEqualTo(value); }
public static short convertBytesToShort(final byte[] bytes) { return (short) ( (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0); }
IEXByteConverter { public static short convertBytesToShort(final byte[] bytes) { return (short) ( (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0); } }
IEXByteConverter { public static short convertBytesToShort(final byte[] bytes) { return (short) ( (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0); } private IEXByteConverter(); }
IEXByteConverter { public static short convertBytesToShort(final byte[] bytes) { return (short) ( (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(...
IEXByteConverter { public static short convertBytesToShort(final byte[] bytes) { return (short) ( (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(...
@Test public void twoObjectsShouldBeEqualWithTheSameNumberInside() { final long number = 43215678L; final IEXPrice iexPrice_1 = new IEXPrice(number); final IEXPrice iexPrice_2 = new IEXPrice(number); assertThat(iexPrice_1).isEqualTo(iexPrice_2); assertThat(iexPrice_1.hashCode()).isEqualTo(iexPrice_2.hashCode()); }
@Override public int hashCode() { return Objects.hashCode(number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int hashCode() { return Objects.hashCode(number); } }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int hashCode() { return Objects.hashCode(number); } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int hashCode() { return Objects.hashCode(number); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Overrid...
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int hashCode() { return Objects.hashCode(number); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Overrid...
@Test public void compareShouldReturnOneForBiggerNumber() { final long biggerNumber = 12345678L; final long smallerNumber = 1234567L; final IEXPrice iexPrice_1 = new IEXPrice(biggerNumber); final IEXPrice iexPrice_2 = new IEXPrice(smallerNumber); assertThat(iexPrice_1.compareTo(iexPrice_2)).isEqualTo(1); }
@Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
@Test public void compareShouldReturnMinusOneForSmallerNumber() { final long biggerNumber = 12345678L; final long smallerNumber = 1234567L; final IEXPrice iexPrice_1 = new IEXPrice(smallerNumber); final IEXPrice iexPrice_2 = new IEXPrice(biggerNumber); assertThat(iexPrice_1.compareTo(iexPrice_2)).isEqualTo(-1); }
@Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
@Test public void compareShouldReturnZeroForEqualsNumbers() { final long number = 12345L; final IEXPrice iexPrice_1 = new IEXPrice(number); final IEXPrice iexPrice_2 = new IEXPrice(number); assertThat(iexPrice_1.compareTo(iexPrice_2)).isEqualTo(0); }
@Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public int compareTo(final IEXPrice iexPrice) { return compare(this.getNumber(), iexPrice.getNumber()); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equal...
@Test public void shouldSuccessfullyCreateMessageBlockInstance() { final IEXMessageHeaderDataBuilder messageHeaderBuilder = IEXMessageHeaderDataBuilder.messageHeader() .withMessageCount((short) 2); final IEXTradeMessageDataBuilder tradeMessageBuilder = IEXTradeMessageDataBuilder.tradeMessage(); final IEXQuoteUpdateMess...
public static IEXSegment createIEXSegment(final byte[] packet) { final List<IEXMessage> iexMessages = new ArrayList<>(); int offset = 40; final IEXMessageHeader iexMessageHeader = IEXMessageHeader.createIEXMessageHeader(Arrays.copyOfRange(packet, 0, offset)); for (int i = 0; i < iexMessageHeader.getMessageCount(); i++)...
IEXTOPSMessageBlock extends IEXSegment { public static IEXSegment createIEXSegment(final byte[] packet) { final List<IEXMessage> iexMessages = new ArrayList<>(); int offset = 40; final IEXMessageHeader iexMessageHeader = IEXMessageHeader.createIEXMessageHeader(Arrays.copyOfRange(packet, 0, offset)); for (int i = 0; i <...
IEXTOPSMessageBlock extends IEXSegment { public static IEXSegment createIEXSegment(final byte[] packet) { final List<IEXMessage> iexMessages = new ArrayList<>(); int offset = 40; final IEXMessageHeader iexMessageHeader = IEXMessageHeader.createIEXMessageHeader(Arrays.copyOfRange(packet, 0, offset)); for (int i = 0; i <...
IEXTOPSMessageBlock extends IEXSegment { public static IEXSegment createIEXSegment(final byte[] packet) { final List<IEXMessage> iexMessages = new ArrayList<>(); int offset = 40; final IEXMessageHeader iexMessageHeader = IEXMessageHeader.createIEXMessageHeader(Arrays.copyOfRange(packet, 0, offset)); for (int i = 0; i <...
IEXTOPSMessageBlock extends IEXSegment { public static IEXSegment createIEXSegment(final byte[] packet) { final List<IEXMessage> iexMessages = new ArrayList<>(); int offset = 40; final IEXMessageHeader iexMessageHeader = IEXMessageHeader.createIEXMessageHeader(Arrays.copyOfRange(packet, 0, offset)); for (int i = 0; i <...
@Test public void shouldSuccessfullyConvertBytesToUnsignedShort() { final int value = 32817; byte[] bytes = IEXByteTestUtil.convertUnsignedShort(value); assertThat(IEXByteConverter.convertBytesToUnsignedShort(bytes)).isEqualTo(value); }
public static int convertBytesToUnsignedShort(final byte[] bytes) { return convertBytesToShort(bytes) & 0xffff; }
IEXByteConverter { public static int convertBytesToUnsignedShort(final byte[] bytes) { return convertBytesToShort(bytes) & 0xffff; } }
IEXByteConverter { public static int convertBytesToUnsignedShort(final byte[] bytes) { return convertBytesToShort(bytes) & 0xffff; } private IEXByteConverter(); }
IEXByteConverter { public static int convertBytesToUnsignedShort(final byte[] bytes) { return convertBytesToShort(bytes) & 0xffff; } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] byte...
IEXByteConverter { public static int convertBytesToUnsignedShort(final byte[] bytes) { return convertBytesToShort(bytes) & 0xffff; } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] byte...
@Test public void shouldSuccessfullyConvertBytesToInt() { final int value = 123456; byte[] bytes = IEXByteTestUtil.convert(value); assertThat(IEXByteConverter.convertBytesToInt(bytes)).isEqualTo(value); }
public static int convertBytesToInt(final byte[] bytes) { return ((0xff & bytes[3]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0 ); }
IEXByteConverter { public static int convertBytesToInt(final byte[] bytes) { return ((0xff & bytes[3]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0 ); } }
IEXByteConverter { public static int convertBytesToInt(final byte[] bytes) { return ((0xff & bytes[3]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0 ); } private IEXByteConverter(); }
IEXByteConverter { public static int convertBytesToInt(final byte[] bytes) { return ((0xff & bytes[3]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0 ); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes);...
IEXByteConverter { public static int convertBytesToInt(final byte[] bytes) { return ((0xff & bytes[3]) << 24 | (0xff & bytes[2]) << 16 | (0xff & bytes[1]) << 8 | (0xff & bytes[0]) << 0 ); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes);...
@Test public void shouldSuccessfullyConvertBytesToLong() { final long value = 1234567891L; byte[] bytes = IEXByteTestUtil.convert(value); assertThat(IEXByteConverter.convertBytesToLong(bytes)).isEqualTo(value); }
public static long convertBytesToLong(final byte[] bytes) { return (long) (0xff & bytes[7]) << 56 | (long) (0xff & bytes[6]) << 48 | (long) (0xff & bytes[5]) << 40 | (long) (0xff & bytes[4]) << 32 | (long) (0xff & bytes[3]) << 24 | (long) (0xff & bytes[2]) << 16 | (long) (0xff & bytes[1]) << 8 | (long) (0xff & bytes[0]...
IEXByteConverter { public static long convertBytesToLong(final byte[] bytes) { return (long) (0xff & bytes[7]) << 56 | (long) (0xff & bytes[6]) << 48 | (long) (0xff & bytes[5]) << 40 | (long) (0xff & bytes[4]) << 32 | (long) (0xff & bytes[3]) << 24 | (long) (0xff & bytes[2]) << 16 | (long) (0xff & bytes[1]) << 8 | (lon...
IEXByteConverter { public static long convertBytesToLong(final byte[] bytes) { return (long) (0xff & bytes[7]) << 56 | (long) (0xff & bytes[6]) << 48 | (long) (0xff & bytes[5]) << 40 | (long) (0xff & bytes[4]) << 32 | (long) (0xff & bytes[3]) << 24 | (long) (0xff & bytes[2]) << 16 | (long) (0xff & bytes[1]) << 8 | (lon...
IEXByteConverter { public static long convertBytesToLong(final byte[] bytes) { return (long) (0xff & bytes[7]) << 56 | (long) (0xff & bytes[6]) << 48 | (long) (0xff & bytes[5]) << 40 | (long) (0xff & bytes[4]) << 32 | (long) (0xff & bytes[3]) << 24 | (long) (0xff & bytes[2]) << 16 | (long) (0xff & bytes[1]) << 8 | (lon...
IEXByteConverter { public static long convertBytesToLong(final byte[] bytes) { return (long) (0xff & bytes[7]) << 56 | (long) (0xff & bytes[6]) << 48 | (long) (0xff & bytes[5]) << 40 | (long) (0xff & bytes[4]) << 32 | (long) (0xff & bytes[3]) << 24 | (long) (0xff & bytes[2]) << 16 | (long) (0xff & bytes[1]) << 8 | (lon...
@Test public void shouldSuccessfullyConvertBytesToIEXPrice() { final IEXPrice iexPrice = new IEXPrice(123456789L); byte[] bytes = IEXByteTestUtil.convert(iexPrice.getNumber()); assertThat(IEXByteConverter.convertBytesToIEXPrice(bytes)).isEqualTo(iexPrice); }
public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) { return new IEXPrice(convertBytesToLong(bytes)); }
IEXByteConverter { public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) { return new IEXPrice(convertBytesToLong(bytes)); } }
IEXByteConverter { public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) { return new IEXPrice(convertBytesToLong(bytes)); } private IEXByteConverter(); }
IEXByteConverter { public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) { return new IEXPrice(convertBytesToLong(bytes)); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] ...
IEXByteConverter { public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) { return new IEXPrice(convertBytesToLong(bytes)); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] ...
@Test public void shouldSuccessfullyConvertBytesToString() { final String symbol = "AAPL"; byte[] bytes = IEXByteTestUtil.convert(symbol); assertThat(IEXByteConverter.convertBytesToString(bytes)).isEqualTo(symbol); }
public static String convertBytesToString(final byte[] bytes) { return new String(bytes).trim(); }
IEXByteConverter { public static String convertBytesToString(final byte[] bytes) { return new String(bytes).trim(); } }
IEXByteConverter { public static String convertBytesToString(final byte[] bytes) { return new String(bytes).trim(); } private IEXByteConverter(); }
IEXByteConverter { public static String convertBytesToString(final byte[] bytes) { return new String(bytes).trim(); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] bytes); static shor...
IEXByteConverter { public static String convertBytesToString(final byte[] bytes) { return new String(bytes).trim(); } private IEXByteConverter(); static long convertBytesToLong(final byte[] bytes); static int convertBytesToInt(final byte[] bytes); static int convertBytesToUnsignedShort(final byte[] bytes); static shor...
@Test public void shouldTwoInstancesWithSameValuesBeEqual() { final IEXMessageHeader iexMessageHeader = defaultMessageHeader(); final List<IEXMessage> iexMessageList = asList(defaultTradeMessage(), defaultTradeMessage()); final IEXSegment iexSegment_1 = new TestIEXSegment(iexMessageHeader, iexMessageList); final IEXSeg...
@Override public int hashCode() { return Objects.hash(messageHeader, messages); }
IEXSegment { @Override public int hashCode() { return Objects.hash(messageHeader, messages); } }
IEXSegment { @Override public int hashCode() { return Objects.hash(messageHeader, messages); } protected IEXSegment( final IEXMessageHeader messageHeader, final List<IEXMessage> messages); }
IEXSegment { @Override public int hashCode() { return Objects.hash(messageHeader, messages); } protected IEXSegment( final IEXMessageHeader messageHeader, final List<IEXMessage> messages); IEXMessageHeader getMessageHeader(); List<IEXMessage> getMessages(); @Override boolean equals(Object o); @...
IEXSegment { @Override public int hashCode() { return Objects.hash(messageHeader, messages); } protected IEXSegment( final IEXMessageHeader messageHeader, final List<IEXMessage> messages); IEXMessageHeader getMessageHeader(); List<IEXMessage> getMessages(); @Override boolean equals(Object o); @...
@Test public void shouldTwoInstancesWithSameValuesBeEqual() { final IEXMessageHeader iexMessageHeader_1 = defaultMessageHeader(); final IEXMessageHeader iexMessageHeader_2 = defaultMessageHeader(); assertThat(iexMessageHeader_1).isEqualTo(iexMessageHeader_2); assertThat(iexMessageHeader_1.hashCode()).isEqualTo(iexMessa...
@Override public int hashCode() { return Objects.hash(version, messageProtocolID, channelID, sessionID, payloadLength, messageCount, streamOffset, firstMessageSequenceNumber, sendTime); }
IEXMessageHeader { @Override public int hashCode() { return Objects.hash(version, messageProtocolID, channelID, sessionID, payloadLength, messageCount, streamOffset, firstMessageSequenceNumber, sendTime); } }
IEXMessageHeader { @Override public int hashCode() { return Objects.hash(version, messageProtocolID, channelID, sessionID, payloadLength, messageCount, streamOffset, firstMessageSequenceNumber, sendTime); } private IEXMessageHeader( final byte version, final IEXMessageProtocol messageProtocolID...
IEXMessageHeader { @Override public int hashCode() { return Objects.hash(version, messageProtocolID, channelID, sessionID, payloadLength, messageCount, streamOffset, firstMessageSequenceNumber, sendTime); } private IEXMessageHeader( final byte version, final IEXMessageProtocol messageProtocolID...
IEXMessageHeader { @Override public int hashCode() { return Objects.hash(version, messageProtocolID, channelID, sessionID, payloadLength, messageCount, streamOffset, firstMessageSequenceNumber, sendTime); } private IEXMessageHeader( final byte version, final IEXMessageProtocol messageProtocolID...
@Test public void shouldSuccessfullyCreateInstanceThroughConstructor() { final long number = 12345678L; final IEXPrice iexPrice = new IEXPrice(number); assertThat(iexPrice.getNumber()).isEqualTo(number); }
public long getNumber() { return number; }
IEXPrice implements Comparable<IEXPrice>, Serializable { public long getNumber() { return number; } }
IEXPrice implements Comparable<IEXPrice>, Serializable { public long getNumber() { return number; } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { public long getNumber() { return number; } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
IEXPrice implements Comparable<IEXPrice>, Serializable { public long getNumber() { return number; } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
@Test public void shouldProperlyFormatPrice() { final long number = 1234567; final IEXPrice iexPrice = new IEXPrice(number); assertThat(iexPrice.toString()).isEqualTo("123.4567"); }
@Override public String toString() { return toBigDecimal() .toString(); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public String toString() { return toBigDecimal() .toString(); } }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public String toString() { return toBigDecimal() .toString(); } IEXPrice(final long number); }
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public String toString() { return toBigDecimal() .toString(); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Ov...
IEXPrice implements Comparable<IEXPrice>, Serializable { @Override public String toString() { return toBigDecimal() .toString(); } IEXPrice(final long number); long getNumber(); BigDecimal toBigDecimal(); @Override int compareTo(final IEXPrice iexPrice); @Override boolean equals(Object o); @Override int hashCode(); @Ov...
@Test public void shouldSaveNewUser_GivenThereDoesNotExistOneWithTheSameId_ThenTheSavedUserShouldBeReturned() throws Exception { final Book savedBook = stubRepositoryToReturnUserOnSave(); final Book book = UserUtil.createBook(); final Book returnedBook = bookService.saveBook(book); verify(bookRepository, times(1)).save...
@Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=%s", book.getId())); } return repository....
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
@Test public void shouldSaveNewUser_GivenThereExistsOneWithTheSameId_ThenTheExceptionShouldBeThrown() throws Exception { stubRepositoryToReturnExistingUser(); try { bookService.saveBook(UserUtil.createBook()); fail("Expected exception"); } catch (BookAlreadyExistsException ignored) { } verify(bookRepository, never()).s...
@Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=%s", book.getId())); } return repository....
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
BookServiceImpl implements BookService { @Override @Transactional public Book saveBook(@NotNull @Valid final Book book) { LOGGER.debug("Creating {}", book); Book existing = repository.findOne(book.getId()); if (existing != null) { throw new BookAlreadyExistsException( String.format("There already exists a book with id=...
@Test public void shouldListAllUsers_GivenThereExistSome_ThenTheCollectionShouldBeReturned() throws Exception { stubRepositoryToReturnExistingUsers(10); Collection<Book> list = bookService.getList(); assertNotNull(list); assertEquals(10, list.size()); verify(bookRepository, times(1)).findAll(); }
@Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); @Override @Transactional Book saveBook(@NotNull @Valid final Boo...
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); @Override @Transactional Book saveBook(@NotNull @Valid final Boo...
@Test public void shouldListAllUsers_GivenThereNoneExist_ThenTheEmptyCollectionShouldBeReturned() throws Exception { stubRepositoryToReturnExistingUsers(0); Collection<Book> list = bookService.getList(); assertNotNull(list); assertTrue(list.isEmpty()); verify(bookRepository, times(1)).findAll(); }
@Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); }
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); @Override @Transactional Book saveBook(@NotNull @Valid final Boo...
BookServiceImpl implements BookService { @Override @Transactional(readOnly = true) public List<Book> getList() { LOGGER.debug("Retrieving the list of all users"); return repository.findAll(); } @Autowired BookServiceImpl(final BookRepository repository); @Override @Transactional Book saveBook(@NotNull @Valid final Boo...
@Test public void shouldCreateUser() throws Exception { final Book savedBook = stubServiceToReturnStoredBook(); final Book book = UserUtil.createBook(); Book returnedBook = bookController.saveBook(book); verify(bookService, times(1)).saveBook(book); assertEquals("Returned book should come from the service", savedBook, ...
@RequestMapping(value = "/books", method = RequestMethod.POST, consumes = {"application/json"}) public Book saveBook(@RequestBody @Valid final Book book) { LOGGER.debug("Received request to create the {}", book); return bookService.saveBook(book); }
BookController { @RequestMapping(value = "/books", method = RequestMethod.POST, consumes = {"application/json"}) public Book saveBook(@RequestBody @Valid final Book book) { LOGGER.debug("Received request to create the {}", book); return bookService.saveBook(book); } }
BookController { @RequestMapping(value = "/books", method = RequestMethod.POST, consumes = {"application/json"}) public Book saveBook(@RequestBody @Valid final Book book) { LOGGER.debug("Received request to create the {}", book); return bookService.saveBook(book); } @Autowired BookController(final BookService bookServ...
BookController { @RequestMapping(value = "/books", method = RequestMethod.POST, consumes = {"application/json"}) public Book saveBook(@RequestBody @Valid final Book book) { LOGGER.debug("Received request to create the {}", book); return bookService.saveBook(book); } @Autowired BookController(final BookService bookServ...
BookController { @RequestMapping(value = "/books", method = RequestMethod.POST, consumes = {"application/json"}) public Book saveBook(@RequestBody @Valid final Book book) { LOGGER.debug("Received request to create the {}", book); return bookService.saveBook(book); } @Autowired BookController(final BookService bookServ...
@Test public void shouldListAllUsers() throws Exception { stubServiceToReturnExistingUsers(10); Collection<Book> books = bookController.listBooks(); assertNotNull(books); assertEquals(10, books.size()); verify(bookService, times(1)).getList(); }
@ApiOperation(value = "Retrieve a list of books.", responseContainer = "List") @RequestMapping(value = "/books", method = RequestMethod.GET, produces = {"application/json"}) public List<Book> listBooks() { LOGGER.debug("Received request to list all books"); return bookService.getList(); }
BookController { @ApiOperation(value = "Retrieve a list of books.", responseContainer = "List") @RequestMapping(value = "/books", method = RequestMethod.GET, produces = {"application/json"}) public List<Book> listBooks() { LOGGER.debug("Received request to list all books"); return bookService.getList(); } }
BookController { @ApiOperation(value = "Retrieve a list of books.", responseContainer = "List") @RequestMapping(value = "/books", method = RequestMethod.GET, produces = {"application/json"}) public List<Book> listBooks() { LOGGER.debug("Received request to list all books"); return bookService.getList(); } @Autowired B...
BookController { @ApiOperation(value = "Retrieve a list of books.", responseContainer = "List") @RequestMapping(value = "/books", method = RequestMethod.GET, produces = {"application/json"}) public List<Book> listBooks() { LOGGER.debug("Received request to list all books"); return bookService.getList(); } @Autowired B...
BookController { @ApiOperation(value = "Retrieve a list of books.", responseContainer = "List") @RequestMapping(value = "/books", method = RequestMethod.GET, produces = {"application/json"}) public List<Book> listBooks() { LOGGER.debug("Received request to list all books"); return bookService.getList(); } @Autowired B...
@Test public void notInRegistry_CallRealEndpoint() { givenWhenFunctionReturns(true); givenEndpointInRegistry(false); testee.newCall(REQUEST); verify(realClient).newCall(REQUEST); verify(mockClient, never()).newCall(any(Request.class)); }
@Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
@Test public void inRegistryAndShouldMock_CallMockedEndpoint() { givenWhenFunctionReturns(true); givenEndpointInRegistry(true); testee.newCall(REQUEST); verify(mockClient).newCall(REQUEST); verify(realClient, never()).newCall(any(Request.class)); }
@Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
@Test public void inRegistryButShouldNotMock_CallRealEndpoint() { givenWhenFunctionReturns(true); givenEndpointInRegistry(false); testee.newCall(REQUEST); verify(realClient).newCall(REQUEST); verify(mockClient, never()).newCall(any(Request.class)); }
@Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } }
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
MockableClient extends OkHttpClient { @Override public Call newCall(Request request) { if (shouldMockRequest(request)) { return mockedClient.newCall(request); } else { return realClient.newCall(request); } } MockableClient(Registry registry, OkHttpClient realClient, ReplaceEndpoint...
@Test public void replaceUrl() { Request realRequest = new Request.Builder() .url(REAL_BASE_URL + PATH) .build(); testee.newCall(realRequest); ArgumentCaptor<Request> requestCaptor = ArgumentCaptor.forClass(Request.class); Mockito.verify(realClient).newCall(requestCaptor.capture()); Request sentRequest = requestCaptor....
@Override public Call newCall(Request request) { return realClient.newCall( withReplacedEndpoint(request) ); }
ReplaceEndpointClient extends OkHttpClient { @Override public Call newCall(Request request) { return realClient.newCall( withReplacedEndpoint(request) ); } }
ReplaceEndpointClient extends OkHttpClient { @Override public Call newCall(Request request) { return realClient.newCall( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint, OkHttpClient realClient); }
ReplaceEndpointClient extends OkHttpClient { @Override public Call newCall(Request request) { return realClient.newCall( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint, OkHttpClient realClient); @Override Call newCall(Request request); }
ReplaceEndpointClient extends OkHttpClient { @Override public Call newCall(Request request) { return realClient.newCall( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint, OkHttpClient realClient); @Override Call newCall(Request request); }
@Test public void inRegistry_Yes_PartialMatch() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
@Test public void inRegistry_Yes_PathParameters() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/{parameterA}/{parameterB}", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
@Test public void inRegistry_Yes_QueryParameters() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); }
public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
@Test public void inRegistry_No() throws Exception { FakeRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertFalse(result); }
public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); }
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ...
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionForUnknownMessageType() { final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage = anIEXPriceLevelUpdateMessage() .withIEXMessageType(IEXMessageType.OPERATIONAL_HALT_STATUS) .build(); final IEXOrderBook orderBook = new IEXOrderBook(TE...
public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessag...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
@Test(expected = IllegalArgumentException.class) public void shouldThrowAnExceptionForUnknownEventFlag() { final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage = anIEXPriceLevelUpdateMessage() .withIEXEventFlag(null) .build(); final IEXOrderBook orderBook = new IEXOrderBook(TEST_SYMBOL); orderBook.priceLevelUpda...
public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceLevelUpdate(iexPriceLevelUpdateMessag...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
IEXOrderBook implements OrderBook { public void priceLevelUpdate(final IEXPriceLevelUpdateMessage iexPriceLevelUpdateMessage) { switch (iexPriceLevelUpdateMessage.getIexMessageType()) { case PRICE_LEVEL_UPDATE_SELL: askSide.priceLevelUpdate(iexPriceLevelUpdateMessage); break; case PRICE_LEVEL_UPDATE_BUY: bidSide.priceL...
@Test public void shouldTwoInstancesWithSameValuesBeEqual() { PriceLevel priceLevel_1 = defaultPriceLevel(); PriceLevel priceLevel_2 = defaultPriceLevel(); assertThat(priceLevel_1).isEqualTo(priceLevel_2); assertThat(priceLevel_1.hashCode()).isEqualTo(priceLevel_2.hashCode()); }
@Override public int hashCode() { return Objects.hash(symbol, timestamp, price, size); }
PriceLevel { @Override public int hashCode() { return Objects.hash(symbol, timestamp, price, size); } }
PriceLevel { @Override public int hashCode() { return Objects.hash(symbol, timestamp, price, size); } PriceLevel( final String symbol, final long timestamp, final IEXPrice price, final int size); }
PriceLevel { @Override public int hashCode() { return Objects.hash(symbol, timestamp, price, size); } PriceLevel( final String symbol, final long timestamp, final IEXPrice price, final int size); String getSymbol(); long getTimestamp(); IEXPrice getPrice(); int getSize();...
PriceLevel { @Override public int hashCode() { return Objects.hash(symbol, timestamp, price, size); } PriceLevel( final String symbol, final long timestamp, final IEXPrice price, final int size); String getSymbol(); long getTimestamp(); IEXPrice getPrice(); int getSize();...