public final class Scales extends Object
ScaleMetrics instances.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SCALE
The maximum scale that can be passed to
getScaleMetrics(int) without causing an
exception; the maximum scale is 18. |
static int |
MIN_SCALE
The minimum scale that can be passed to
getScaleMetrics(int) without causing an
exception; the minimum scale is 0. |
static List<ScaleMetrics> |
VALUES
All scale metric constants in an immutable ordered list:
VALUES=[Scale0f.INSTANCE, Scale1f.INSTANCE, ..., Scale18f.INSTANCE] |
| Modifier and Type | Method and Description |
|---|---|
static ScaleMetrics |
findByScaleFactor(long scaleFactor)
Returns the
ScaleMetrics constant that matches the given
scaleFactor if any and null otherwise. |
static ScaleMetrics |
getScaleMetrics(int scale)
Returns the
ScaleMetrics constant based on a given scale |
public static final List<ScaleMetrics> VALUES
VALUES=[Scale0f.INSTANCE, Scale1f.INSTANCE, ..., Scale18f.INSTANCE]public static final int MIN_SCALE
getScaleMetrics(int) without causing an
exception; the minimum scale is 0.public static final int MAX_SCALE
getScaleMetrics(int) without causing an
exception; the maximum scale is 18.public static final ScaleMetrics getScaleMetrics(int scale)
ScaleMetrics constant based on a given scalescale - the scale value; must be in [0,18] both ends inclusivescaleIllegalArgumentException - if scale is not in [0, 18]MIN_SCALE,
MAX_SCALEpublic static final ScaleMetrics findByScaleFactor(long scaleFactor)
ScaleMetrics constant that matches the given
scaleFactor if any and null otherwise.scaleFactor - the scale factor to findScaleMetrics.getScaleFactor() equal to
scaleFactor if it exists and null otherwiseScaleMetrics.getScaleFactor()