mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
add hashcode and equals to Capacity
This commit is contained in:
parent
82565b4416
commit
6eee38d2fc
1 changed files with 17 additions and 0 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package com.graphhopper.jsprit.core.problem;
|
package com.graphhopper.jsprit.core.problem;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Capacity with an arbitrary number of capacity-dimension.
|
* Capacity with an arbitrary number of capacity-dimension.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -290,5 +292,20 @@ public class Capacity {
|
||||||
return toReturnBuilder.build();
|
return toReturnBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (!(o instanceof Capacity)) return false;
|
||||||
|
|
||||||
|
Capacity capacity = (Capacity) o;
|
||||||
|
|
||||||
|
if (!Arrays.equals(dimensions, capacity.dimensions)) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Arrays.hashCode(dimensions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue