Package net.jqwik.api
Class ShrinkingDistance
- java.lang.Object
-
- net.jqwik.api.ShrinkingDistance
-
- All Implemented Interfaces:
java.lang.Comparable<ShrinkingDistance>
@API(status=STABLE, since="1.0") public class ShrinkingDistance extends java.lang.Object implements java.lang.Comparable<ShrinkingDistance>
AShrinkingDistance
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
Fields Modifier and Type Field Description static ShrinkingDistance
MAX
static ShrinkingDistance
MIN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ShrinkingDistance
append(ShrinkingDistance other)
static <T> ShrinkingDistance
combine(java.util.List<Shrinkable<T>> shrinkables)
int
compareTo(ShrinkingDistance other)
Compare to distances with each other.java.util.List<ShrinkingDistance>
dimensions()
boolean
equals(@Nullable java.lang.Object o)
static <T> ShrinkingDistance
forCollection(java.util.Collection<Shrinkable<T>> elements)
int
hashCode()
static ShrinkingDistance
of(long... distances)
Create aShrinkingDistance
with one or more dimensions.ShrinkingDistance
plus(ShrinkingDistance other)
int
size()
java.lang.String
toString()
-
-
-
Field Detail
-
MAX
@API(status=MAINTAINED, since="1.2.0") public static final ShrinkingDistance MAX
-
MIN
@API(status=MAINTAINED, since="1.7.2") public static final ShrinkingDistance MIN
-
-
Method Detail
-
of
@API(status=MAINTAINED, since="1.0") public static ShrinkingDistance of(long... distances)
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(java.util.Collection<Shrinkable<T>> elements)
-
combine
@API(status=MAINTAINED, since="1.0") public static <T> ShrinkingDistance combine(java.util.List<Shrinkable<T>> shrinkables)
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(ShrinkingDistance other)
Compare to distances with each other. No distance can be greater thanMAX
. No distance can be smaller thanMIN
.- Specified by:
compareTo
in interfacejava.lang.Comparable<ShrinkingDistance>
-
dimensions
@API(status=INTERNAL) public java.util.List<ShrinkingDistance> dimensions()
-
size
@API(status=INTERNAL) public int size()
-
plus
@API(status=INTERNAL) public ShrinkingDistance plus(ShrinkingDistance other)
-
append
@API(status=INTERNAL) public ShrinkingDistance append(ShrinkingDistance other)
-
-