- 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 Percentage
INHERITED
static @NotNull Percentage
ONE
static @NotNull Percentage
UNSPECIFIED
static float
UNSPECIFIED_RAW
private float
value
static @NotNull Percentage
ZERO
-
Constructor Summary
Constructors Constructor Description Percentage(float value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull Percentage o)
boolean
equals(java.lang.Object o)
float
get(@NotNull MeasureContext context)
int
hashCode()
boolean
isSpecified()
static boolean
isSpecified(float value)
boolean
isUnspecified()
static boolean
isUnspecified(float value)
@NotNull PercentageValue
multiply(@NotNull PercentageValue other)
@NotNull Percentage
orElseIfUnspecified(float value)
java.lang.String
toString()
float
value()
-
-
-
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:
get
in interfacePercentageValue
-
multiply
@NotNull public @NotNull PercentageValue multiply(@NotNull @NotNull PercentageValue other)
- Specified by:
multiply
in 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:
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(@NotNull @NotNull Percentage o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Percentage>
-
-