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:
parent
6143e73645
commit
87e933aafc
1 changed files with 24 additions and 0 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue