1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add docs to location

This commit is contained in:
oblonski 2016-10-16 21:00:44 +02:00
parent 6143e73645
commit 87e933aafc
No known key found for this signature in database
GPG key ID: 179DE487285680D1

View file

@ -70,22 +70,46 @@ public final class Location implements HasIndex, HasId {
return new Builder(); return new Builder();
} }
/**
* Sets location index
*
* @param index
* @return the builder
*/
public Builder setIndex(int index) { public Builder setIndex(int index) {
if (index < 0) throw new IllegalArgumentException("index must be >= 0"); if (index < 0) throw new IllegalArgumentException("index must be >= 0");
this.index = index; this.index = index;
return this; return this;
} }
/**
* Sets coordinate of location
*
* @param coordinate
* @return
*/
public Builder setCoordinate(Coordinate coordinate) { public Builder setCoordinate(Coordinate coordinate) {
this.coordinate = coordinate; this.coordinate = coordinate;
return this; return this;
} }
/**
* Sets location id
*
* @param id
* @return
*/
public Builder setId(String id) { public Builder setId(String id) {
this.id = id; this.id = id;
return this; return this;
} }
/**
* Adds name, e.g. street name, to location
*
* @param name
* @return
*/
public Builder setName(String name){ public Builder setName(String name){
this.name = name; this.name = name;
return this; return this;