Class Length
java.lang.Object
com.github.weisj.jsvg.geometry.size.Length
- All Implemented Interfaces:
LengthValue
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Length@NotNull LengthcoercePercentageToCorrectUnit(@NotNull UnitType unitType, @NotNull PercentageDimension dimension) booleaninthashCode()booleanbooleanbooleanbooleanstatic booleanisSpecified(float value) booleanstatic booleanisUnspecified(float value) booleanisZero()@NotNull Lengthmultiply(float scalingFactor) @NotNull LengthorElseIfUnspecified(float value) floatraw()floatresolve(@NotNull MeasureContext context) Resolve the length to its effective value.floatresolveFontSize(@NotNull MeasureContext context) Used for resolving font sizes.private static floatresolveNonPercentage(@NotNull MeasureContext context, Unit unit, float value) @NotNull StringtoString()@NotNull Unitunit()
-
Field Details
-
UNSPECIFIED_RAW
public static final float UNSPECIFIED_RAW- See Also:
-
UNSPECIFIED
-
ZERO
-
ONE
-
INHERITED
-
unit
-
value
private final float value -
PIXELS_PER_INCH
private static final float PIXELS_PER_INCH- See Also:
-
INCHES_PER_CM
private static final float INCHES_PER_CM- See Also:
-
-
Constructor Details
-
Length
-
Length
-
-
Method Details
-
isUnspecified
public static boolean isUnspecified(float value) -
isSpecified
public static boolean isSpecified(float value) -
resolveNonPercentage
private static float resolveNonPercentage(@NotNull @NotNull MeasureContext context, Unit unit, float value) -
resolve
Description copied from interface:LengthValueResolve the length to its effective value.- Specified by:
resolvein interfaceLengthValue- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
resolveFontSize
Used for resolving font sizes. Relative values will be resolves with respect to the current font size. This isn't dependent on the current viewBox.- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
toString
-
isZero
public boolean isZero() -
isConstantlyZero
public boolean isConstantlyZero()- Specified by:
isConstantlyZeroin interfaceLengthValue
-
isConstantlyNonNegative
public boolean isConstantlyNonNegative()- Specified by:
isConstantlyNonNegativein interfaceLengthValue
-
isAbsolute
public boolean isAbsolute() -
raw
public float raw() -
unit
-
isUnspecified
public boolean isUnspecified() -
isSpecified
public boolean isSpecified() -
coerceNonNegative
-
coercePercentageToCorrectUnit
@NotNull public @NotNull Length coercePercentageToCorrectUnit(@NotNull @NotNull UnitType unitType, @NotNull @NotNull PercentageDimension dimension) -
orElseIfUnspecified
-
multiply
-
equals
-
hashCode
-