@API(status=STABLE, since="1.0") public class ShrinkingDistance extends java.lang.Object implements java.lang.Comparable<ShrinkingDistance>
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.
Modifier and Type | Field and Description |
---|---|
static ShrinkingDistance |
MAX |
static ShrinkingDistance |
MIN |
Modifier and Type | Method and 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 a
ShrinkingDistance with one or more dimensions. |
ShrinkingDistance |
plus(ShrinkingDistance other) |
int |
size() |
java.lang.String |
toString() |
@API(status=MAINTAINED, since="1.2.0") public static final ShrinkingDistance MAX
@API(status=MAINTAINED, since="1.7.2") public static final ShrinkingDistance MIN
@API(status=MAINTAINED, since="1.0") public static ShrinkingDistance of(long... distances)
ShrinkingDistance
with one or more dimensions.distances
- a non-empty array of non-negative values.ShrinkingDistance
@API(status=MAINTAINED, since="1.0") public static <T> ShrinkingDistance forCollection(java.util.Collection<Shrinkable<T>> elements)
@API(status=MAINTAINED, since="1.0") public static <T> ShrinkingDistance combine(java.util.List<Shrinkable<T>> shrinkables)
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(ShrinkingDistance other)
MAX
.
No distance can be smaller than MIN
.compareTo
in interface java.lang.Comparable<ShrinkingDistance>
@API(status=INTERNAL) public java.util.List<ShrinkingDistance> dimensions()
@API(status=INTERNAL) public int size()
@API(status=INTERNAL) public ShrinkingDistance plus(ShrinkingDistance other)
@API(status=INTERNAL) public ShrinkingDistance append(ShrinkingDistance other)