Package net.jqwik.api
Class ShrinkingDistance
java.lang.Object
net.jqwik.api.ShrinkingDistance
- All Implemented Interfaces:
Comparable<ShrinkingDistance>
@API(status=STABLE,
since="1.0")
public class ShrinkingDistance
extends Object
implements Comparable<ShrinkingDistance>
A
ShrinkingDistance
is a measure of how close a value is to the minimum value,
aka target value.
The distance is used during shrinking to determine if a shrunk value is really closer to the target value. If it is not, the value is being discarded.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionappend
(ShrinkingDistance other) static <T> ShrinkingDistance
combine
(List<Shrinkable<T>> shrinkables) int
compareTo
(ShrinkingDistance other) Compare to distances with each other.boolean
static <T> ShrinkingDistance
forCollection
(Collection<Shrinkable<T>> elements) int
hashCode()
static ShrinkingDistance
of
(long... distances) Create aShrinkingDistance
with one or more dimensions.plus
(ShrinkingDistance other) int
size()
toString()
-
Field Details
-
MAX
-
MIN
-
-
Method Details
-
of
Create aShrinkingDistance
with one or more dimensions.- Parameters:
distances
- a non-empty array of non-negative values.- Returns:
- an immutable instance of
ShrinkingDistance
-
forCollection
@API(status=MAINTAINED, since="1.0") public static <T> ShrinkingDistance forCollection(Collection<Shrinkable<T>> elements) -
combine
@API(status=MAINTAINED, since="1.0") public static <T> ShrinkingDistance combine(List<Shrinkable<T>> shrinkables) -
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
Compare to distances with each other. No distance can be greater thanMAX
. No distance can be smaller thanMIN
.- Specified by:
compareTo
in interfaceComparable<ShrinkingDistance>
-
dimensions
-
size
@API(status=INTERNAL) public int size() -
plus
-
append
-