Computes horizontal extend of the map view.

@return the longitude span of the map in degrees
484383
public double getLongitudeSpan() {
        if (this.mapView.getWidth() > 0 && this.mapView.getHeight() > 0) {
            LatLong left = fromPixels(0, 0);
            LatLong right = fromPixels(this.mapView.getWidth(), 0);
            return Math.abs(left.longitude - right.longitude);
        }
        throw new IllegalStateException(INVALID_MAP_VIEW_DIMENSIONS);
    }
714649
public double getEast() {
        Double e = get(EAST);
        if (e != null) {
            return e;
        }
        return HMConstants.doubleNovalue;
    }
182846
function getExtendedBounds(map, bounds, gridSize) {
  // Turn the bounds into latlng.
  var northEastLat = bounds && bounds.getNorthEast() && bounds.getNorthEast().lat;
  var northEastLng = bounds && bounds.getNorthEast() && bounds.getNorthEast().lng;
  var southWestLat = bounds && bounds.getSouthWest() && bounds.getSouthWest().lat;
  var southWestLng = bounds && bounds.getSouthWest() && bounds.getSouthWest().lng;

  var tr = _leaflet2.default.latLng(northEastLat, northEastLng);
  var bl = _leaflet2.default.latLng(southWestLat, southWestLng);

  // Convert the points to pixels and the extend out by the grid size.
  var trPix = map.latLngToLayerPoint(tr);
  trPix.x += gridSize;
  trPix.y -= gridSize;

  var blPix = map.latLngToLayerPoint(bl);
  blPix.x -= gridSize;
  blPix.y += gridSize;

  // Convert the pixel points back to LatLng
  var ne = map.layerPointToLatLng(trPix);
  var sw = map.layerPointToLatLng(blPix);

  // Extend the bounds to contain the new bounds.
  bounds.extend(ne);
  bounds.extend(sw);

  return bounds;
}
36476
private Rectangle2D getBoundsHintHorizontal() {

    if (!chart.getStyler().isLegendVisible()) {
      return new Rectangle2D
          .Double(); // Constructs a new Rectangle2D, initialized to location (0, 0) and size (0,
      // 0).
    }

    // determine legend text content max height
    double legendTextContentMaxHeight = 0;

    // determine total legend content width
    double legendContentWidth = 0;

    Map<String, S> map = chart.getSeriesMap();
    for (S series : map.values()) {

      if (!series.isShowInLegend()) {
        continue;
      }
      if (!series.isEnabled()) {
        continue;
      }

      Map<String, Rectangle2D> seriesTextBounds = getSeriesTextBounds(series);

      double legendEntryHeight = 0; // could be multi-line
      double legendEntryMaxWidth = 0; // could be multi-line
      for (Map.Entry<String, Rectangle2D> entry : seriesTextBounds.entrySet()) {
        legendEntryHeight += entry.getValue().getHeight() + MULTI_LINE_SPACE;
        legendEntryMaxWidth = Math.max(legendEntryMaxWidth, entry.getValue().getWidth());
      }

      legendEntryHeight -= MULTI_LINE_SPACE; // subtract away the bottom MULTI_LINE_SPACE
      legendTextContentMaxHeight =
          Math.max(legendEntryHeight, getSeriesLegendRenderGraphicHeight(series));

      legendContentWidth += legendEntryMaxWidth + chart.getStyler().getLegendPadding();

      if (series.getLegendRenderType() == LegendRenderType.Line) {
        legendContentWidth =
            chart.getStyler().getLegendSeriesLineLength()
                + chart.getStyler().getLegendPadding()
                + legendContentWidth;
      } else {
        legendContentWidth = BOX_SIZE + chart.getStyler().getLegendPadding() + legendContentWidth;
      }
    }

    // Legend Box
    double width = legendContentWidth + chart.getStyler().getLegendPadding();
    double height = legendTextContentMaxHeight + chart.getStyler().getLegendPadding() * 2;

    return new Rectangle2D.Double(0, 0, width, height); // 0 indicates not sure yet.
  }
365227
public Map<V, Integer> inDegree() {
        Map<V, Integer> result = new HashMap<>();
        for (V vertex : neighbors.keySet()) {
            result.put(vertex, 0); // all in-degrees are 0
        }
        for (V from : neighbors.keySet()) {
            for (V to : neighbors.get(from)) {
                result.put(to, result.get(to) + 1); // increment in-degree
            }
        }

        return result;
    }
1340515
protected synchronized BoundingBox getCurBounds() {
        if (currBoundingBox == null) {
            if (mapView == null) {
                throw new NullPointerException("mapView == null");
            }
            if (mapView.getWidth() <= 0 || mapView.getHeight() <= 0) {
                throw new IllegalArgumentException(" mapView.getWidth() <= 0 " +
                        "|| mapView.getHeight() <= 0 "
                        + mapView.getWidth() + " || " + mapView.getHeight());
            }
            /** North-West geo point of the bound */
            LatLong nw_ = mapView.getMapViewProjection().fromPixels(0, 0);
//            Log.e(TAG, " nw_.latitude => " + nw_.latitude + " nw_.longitude => " + nw_.longitude );
            /** South-East geo point of the bound */
            LatLong se_ = mapView.getMapViewProjection().fromPixels(mapView.getWidth(),
                    mapView.getHeight());
//            Log.e(TAG, " se_.latitude => " + se_.latitude + " se_.longitude => " + se_.longitude );
            if (nw_ != null && se_ != null) {
                if (se_.latitude > nw_.latitude) {
                    currBoundingBox = new BoundingBox(nw_.latitude, se_.longitude, se_.latitude,
                            nw_.longitude);
                } else {
                    currBoundingBox = new BoundingBox(se_.latitude, nw_.longitude, nw_.latitude,
                            se_.longitude);
                }
            }
        }
        return currBoundingBox;
    }
293840
private double getStartAngle() {
        ScaleDirection scaleDirection = gauge.getScaleDirection();
        Pos            knobPosition   = gauge.getKnobPosition();
        switch(knobPosition) {
            case TOP_CENTER   : return ScaleDirection.CLOCKWISE == scaleDirection ? angleRange * 0.5 : -angleRange * 0.5;
            case BOTTOM_CENTER:
            default           : return ScaleDirection.CLOCKWISE == scaleDirection ? 180 + angleRange * 0.5 : 180 - angleRange * 0.5;
        }
    }
767572
public int getViewSize() {
        if(viewSize > 0) {
            return viewSize;
        }
        if(direction == Direction.HORIZONTAL) {
            return getSize().getColumns();
        }
        else {
            return getSize().getRows();
        }
    }
863993
protected Coordinate calculatePosition(boolean zoomIn, Coordinate rescalePoint) {
		ViewPort viewPort = mapPresenter.getViewPort();
		Coordinate position = viewPort.getPosition();
		int index = viewPort.getResolutionIndex(viewPort.getResolution());
		double resolution = viewPort.getResolution();
		if (zoomIn && index < viewPort.getResolutionCount() - 1) {
			resolution = viewPort.getResolution(index + 1);

		} else if (!zoomIn && index > 0) {
			resolution = viewPort.getResolution(index - 1);
		}
		double factor = viewPort.getResolution() / resolution;
		double dX = (rescalePoint.getX() - position.getX()) * (1 - 1 / factor);
		double dY = (rescalePoint.getY() - position.getY()) * (1 - 1 / factor);

		return new Coordinate(position.getX() + dX, position.getY() + dY);
	}
537719
function () {
        var maxExtent = null;
        var features = this.features;
        if(features && (features.length > 0)) {
            var geometry = null;
            for(var i=0, len=features.length; i<len; i++) {
                geometry = features[i].geometry;
                if (geometry) {
                    if (maxExtent === null) {
                        maxExtent = new OpenLayers.Bounds();
                    }
                    maxExtent.extend(geometry.getBounds());
                }
            }
        }
        return maxExtent;
    }
542607
public Coordinate[] getCoordinates() {
		if (isEmpty()) {
			return null;
		}
		int len = getNumPoints();
		Coordinate[] coordinates = new Coordinate[len];
		int count;
		for (count = 0; count < exteriorRing.getNumPoints(); count++) {
			coordinates[count] = exteriorRing.getCoordinateN(count);
		}
		if (interiorRings != null) {
			for (LinearRing interiorRing : interiorRings) {
				for (int n = 0; n < interiorRing.getNumPoints(); n++) {
					coordinates[count++] = interiorRing.getCoordinateN(n);
				}
			}
		}
		return coordinates;
	}
77600
protected double getWorldRadius() {
		if (center != null) {
			Coordinate screenEndPoint = new Coordinate(center.getX() + radius, center.getY());
			Coordinate worldEndPoint = mapWidget.getMapModel().getMapView().getWorldViewTransformer().viewToWorld(
					screenEndPoint);
			double deltaX = worldEndPoint.getX() - getWorldCenter().getX();
			double deltaY = worldEndPoint.getY() - getWorldCenter().getY();
			return (float) Math.sqrt((deltaX * deltaX) + (deltaY * deltaY));
		}
		return 0;
	}
670080
private double getStartAngle() {
        ScaleDirection scaleDirection = gauge.getScaleDirection();
        Pos            knobPosition   = gauge.getKnobPosition();
        switch(knobPosition) {
            case BOTTOM_LEFT : return ScaleDirection.CLOCKWISE == scaleDirection ? 180 : 90;
            case TOP_LEFT    : return ScaleDirection.CLOCKWISE == scaleDirection ?  90 : 0;
            case TOP_RIGHT   : return ScaleDirection.CLOCKWISE == scaleDirection ?   0 : 270;
            case BOTTOM_RIGHT:
            default          : return ScaleDirection.CLOCKWISE == scaleDirection ? 270 : 180;
        }
    }
475203
public Tile getRight() {
        int x = tileX + 1;
        if (x > getMaxTileNumber(this.zoomLevel)) {
            x = 0;
        }
        return new Tile(x, this.tileY, this.zoomLevel, this.tileSize);
    }
933793
@Pure
	protected Rectangle2d calcBounds() {
		final Rectangle2d bb = new Rectangle2d();
		boolean first = true;
		Rectangle2afp<?, ?, ?, ?, ?, ?> b;

		// Child bounds
		N child;
		for (int i = 0; i < getChildCount(); ++i) {
			child = getChildAt(i);
			if (child != null) {
				b = child.getBounds();
				if (b != null) {
					if (first) {
						first = false;
						bb.setFromCorners(
								b.getMinX(),
								b.getMinY(),
								b.getMaxX(),
								b.getMaxY());
					} else {
						bb.setUnion(b);
					}
				}
			}
		}

		// Data bounds
		P primitive;
		GeoLocation location;
		for (int i = 0; i < getUserDataCount(); ++i) {
			primitive = getUserDataAt(i);
			if (primitive != null) {
				location = primitive.getGeoLocation();
				if (location != null) {
					b = location.toBounds2D();
					if (b != null) {
						if (first) {
							first = false;
							bb.setFromCorners(
									b.getMinX(),
									b.getMinY(),
									b.getMaxX(),
									b.getMaxY());
						} else {
							bb.setUnion(b);
						}
					}
				}
			}
		}

		return first ? null : bb;
	}
1329460
public Coordinate[] getCoordinates() {
		if (isEmpty()) {
			return null;
		}
		Coordinate[] coordinates = new Coordinate[getNumPoints()];
		int count = 0;
		for (LineString lineString : lineStrings) {
			for (int j = 0; j < lineString.getNumPoints(); j++) {
				coordinates[count++] = lineString.getCoordinateN(j);
			}
		}
		return coordinates;
	}
84717
public BoundingBox extendMargin(float margin) {
        if (margin == 1) {
            return this;
        } else if (margin <= 0) {
            throw new IllegalArgumentException("BoundingBox extend operation does not accept negative or zero values");
        }

        double verticalExpansion = (this.getLatitudeSpan() * margin - this.getLatitudeSpan()) * 0.5;
        double horizontalExpansion = (this.getLongitudeSpan() * margin - this.getLongitudeSpan()) * 0.5;

        double minLat = Math.max(MercatorProjection.LATITUDE_MIN, this.minLatitude - verticalExpansion);
        double minLon = Math.max(-180, this.minLongitude - horizontalExpansion);
        double maxLat = Math.min(MercatorProjection.LATITUDE_MAX, this.maxLatitude + verticalExpansion);
        double maxLon = Math.min(180, this.maxLongitude + horizontalExpansion);

        return new BoundingBox(minLat, minLon, maxLat, maxLon);
    }