Class Capacity.Builder
java.lang.Object
com.graphhopper.jsprit.core.problem.Capacity.Builder
- Enclosing class:
Capacity
Builder that builds Capacity
- Author:
- schroeder
-
Method Summary
Modifier and TypeMethodDescriptionaddDimension(int index, int dimValue) add capacity dimensionbuild()Builds an immutable Capacity and returns it.static Capacity.BuilderReturns a new instance of Capacity with one dimension and a value/size of 0withCapacity(int capacity) Sets initial capacity for more efficient building when dimension count is known
-
Method Details
-
newInstance
Returns a new instance of Capacity with one dimension and a value/size of 0- Returns:
- this builder
-
withCapacity
Sets initial capacity for more efficient building when dimension count is known- Parameters:
capacity- the initial capacity- Returns:
- this builder
-
addDimension
add capacity dimensionNote that it automatically resizes dimensions according to index, i.e. if index=7 there are 8 dimensions. New dimensions then are initialized with 0
- Parameters:
index- dimensionIndexdimValue- dimensionValue- Returns:
- this builder
-
build
Builds an immutable Capacity and returns it.- Returns:
- Capacity
-