/** * Set routing request from specified startPlace to endPlace with a preferred start and end * heading. Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest(GHPoint startPlace, GHPoint endPlace, double startHeading, double endHeading) { if (startPlace == null) throw new IllegalStateException("'from' cannot be null"); if (endPlace == null) throw new IllegalStateException("'to' cannot be null"); points = new ArrayList<>(2); points.add(startPlace); points.add(endPlace); favoredHeadings = new ArrayList<>(2); validateAzimuthValue(startHeading); favoredHeadings.add(startHeading); validateAzimuthValue(endHeading); favoredHeadings.add(endHeading); }
/** * Add stopover point to routing request. * <p> * * @param point geographical position (see GHPoint) * @param favoredHeading north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest addPoint(GHPoint point, double favoredHeading) { if (point == null) throw new IllegalArgumentException("point cannot be null"); if (!possibleToAdd) throw new IllegalStateException("Please call empty constructor if you intent to use " + "more than two places via addPoint method."); points.add(point); validateAzimuthValue(favoredHeading); favoredHeadings.add(favoredHeading); return this; }
/** * Set routing request * <p> * * @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end * @param favoredHeadings List of favored headings for starting (start point) and arrival (via * and end points) Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal */ public GHRequest(List<GHPoint> points, List<Double> favoredHeadings) { if (points.size() != favoredHeadings.size()) throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size() + ") must match size of points (" + points.size() + ")"); for (Double heading : favoredHeadings) { validateAzimuthValue(heading); } this.points = points; this.favoredHeadings = favoredHeadings; }
/** * Add stopover point to routing request. * <p> * * @param point geographical position (see GHPoint) * @param favoredHeading north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest addPoint(GHPoint point, double favoredHeading) { if (point == null) throw new IllegalArgumentException("point cannot be null"); if (!possibleToAdd) throw new IllegalStateException("Please call empty constructor if you intent to use " + "more than two places via addPoint method."); points.add(point); validateAzimuthValue(favoredHeading); favoredHeadings.add(favoredHeading); return this; }
/** * Add stopover point to routing request. * <p> * * @param point geographical position (see GHPoint) * @param favoredHeading north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest addPoint(GHPoint point, double favoredHeading) { if (point == null) throw new IllegalArgumentException("point cannot be null"); if (!possibleToAdd) throw new IllegalStateException("Please call empty constructor if you intent to use " + "more than two places via addPoint method."); points.add(point); validateAzimuthValue(favoredHeading); favoredHeadings.add(favoredHeading); return this; }
/** * Set routing request from specified startPlace to endPlace with a preferred start and end * heading. Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest(GHPoint startPlace, GHPoint endPlace, double startHeading, double endHeading) { if (startPlace == null) throw new IllegalStateException("'from' cannot be null"); if (endPlace == null) throw new IllegalStateException("'to' cannot be null"); points = new ArrayList<GHPoint>(2); points.add(startPlace); points.add(endPlace); favoredHeadings = new ArrayList<Double>(2); validateAzimuthValue(startHeading); favoredHeadings.add(startHeading); validateAzimuthValue(endHeading); favoredHeadings.add(endHeading); }
/** * Set routing request from specified startPlace to endPlace with a preferred start and end * heading. Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest( GHPoint startPlace, GHPoint endPlace, double startHeading, double endHeading ) { if (startPlace == null) throw new IllegalStateException("'from' cannot be null"); if (endPlace == null) throw new IllegalStateException("'to' cannot be null"); points = new ArrayList<GHPoint>(2); points.add(startPlace); points.add(endPlace); favoredHeadings = new ArrayList<Double>(2); validateAzimuthValue(startHeading); favoredHeadings.add(startHeading); validateAzimuthValue(endHeading); favoredHeadings.add(endHeading); }
/** * Add stopover point to routing request. * <p> * @param point geographical position (see GHPoint) * @param favoredHeading north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest addPoint( GHPoint point, double favoredHeading ) { if (point == null) throw new IllegalArgumentException("point cannot be null"); if (!possibleToAdd) throw new IllegalStateException("Please call empty constructor if you intent to use " + "more than two places via addPoint method."); points.add(point); validateAzimuthValue(favoredHeading); favoredHeadings.add(favoredHeading); return this; }
/** * Set routing request from specified startPlace to endPlace with a preferred start and end * heading. Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference */ public GHRequest(GHPoint startPlace, GHPoint endPlace, double startHeading, double endHeading) { if (startPlace == null) throw new IllegalStateException("'from' cannot be null"); if (endPlace == null) throw new IllegalStateException("'to' cannot be null"); points = new ArrayList<>(2); points.add(startPlace); points.add(endPlace); favoredHeadings = new ArrayList<>(2); validateAzimuthValue(startHeading); favoredHeadings.add(startHeading); validateAzimuthValue(endHeading); favoredHeadings.add(endHeading); }
/** * Set routing request * <p> * * @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end * @param favoredHeadings List of favored headings for starting (start point) and arrival (via * and end points) Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal */ public GHRequest(List<GHPoint> points, List<Double> favoredHeadings) { if (points.size() != favoredHeadings.size()) throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size() + ") must match size of points (" + points.size() + ")"); for (Double heading : favoredHeadings) { validateAzimuthValue(heading); } this.points = points; this.favoredHeadings = favoredHeadings; }
/** * Set routing request * <p> * @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end * @param favoredHeadings List of favored headings for starting (start point) and arrival (via * and end points) Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal * preference */ public GHRequest( List<GHPoint> points, List<Double> favoredHeadings ) { if (points.size() != favoredHeadings.size()) throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size() + ") must match size of points (" + points.size() + ")"); for (Double heading : favoredHeadings) { validateAzimuthValue(heading); } this.points = points; this.favoredHeadings = favoredHeadings; }
/** * Set routing request * <p> * * @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end * @param favoredHeadings List of favored headings for starting (start point) and arrival (via * and end points) Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal */ public GHRequest(List<GHPoint> points, List<Double> favoredHeadings) { if (points.size() != favoredHeadings.size()) throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size() + ") must match size of points (" + points.size() + ")"); for (Double heading : favoredHeadings) { validateAzimuthValue(heading); } this.points = points; this.favoredHeadings = favoredHeadings; }