- java.lang.Object
-
- com.github.weisj.jsvg.geometry.size.Percentage
-
- All Implemented Interfaces:
PercentageValue,java.lang.Comparable<Percentage>
@Immutable public final class Percentage extends java.lang.Object implements java.lang.Comparable<Percentage>, PercentageValue
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull PercentageINHERITEDstatic @NotNull PercentageONEstatic @NotNull PercentageUNSPECIFIEDstatic floatUNSPECIFIED_RAWprivate floatvaluestatic @NotNull PercentageZERO
-
Constructor Summary
Constructors Constructor Description Percentage(float value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull Percentage o)booleanequals(java.lang.Object o)floatget(@NotNull MeasureContext context)inthashCode()booleanisSpecified()static booleanisSpecified(float value)booleanisUnspecified()static booleanisUnspecified(float value)@NotNull PercentageValuemultiply(@NotNull PercentageValue other)@NotNull PercentageorElseIfUnspecified(float value)java.lang.StringtoString()floatvalue()
-
-
-
Field Detail
-
UNSPECIFIED_RAW
public static final float UNSPECIFIED_RAW
- See Also:
- Constant Field Values
-
UNSPECIFIED
@NotNull public static final @NotNull Percentage UNSPECIFIED
-
ZERO
@NotNull public static final @NotNull Percentage ZERO
-
ONE
@NotNull public static final @NotNull Percentage ONE
-
INHERITED
@NotNull public static final @NotNull Percentage INHERITED
-
value
private final float value
-
-
Method Detail
-
isUnspecified
public static boolean isUnspecified(float value)
-
isSpecified
public static boolean isSpecified(float value)
-
value
public float value()
-
get
public float get(@NotNull @NotNull MeasureContext context)- Specified by:
getin interfacePercentageValue
-
multiply
@NotNull public @NotNull PercentageValue multiply(@NotNull @NotNull PercentageValue other)
- Specified by:
multiplyin interfacePercentageValue
-
isUnspecified
public boolean isUnspecified()
-
isSpecified
public boolean isSpecified()
-
orElseIfUnspecified
@NotNull public @NotNull Percentage orElseIfUnspecified(float value)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull Percentage o)- Specified by:
compareToin interfacejava.lang.Comparable<Percentage>
-
-