Class Percentage

java.lang.Object
com.github.weisj.jsvg.geometry.size.Percentage
All Implemented Interfaces:
PercentageValue, Comparable<Percentage>

@Immutable public final class Percentage extends Object implements Comparable<Percentage>, PercentageValue
  • Field Details

    • UNSPECIFIED_RAW

      public static final float UNSPECIFIED_RAW
      See Also:
    • 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
  • Constructor Details

    • Percentage

      public Percentage(float value)
  • Method Details

    • 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 interface PercentageValue
    • multiply

      @NotNull public @NotNull PercentageValue multiply(@NotNull @NotNull PercentageValue other)
      Specified by:
      multiply in interface PercentageValue
    • isUnspecified

      public boolean isUnspecified()
    • isSpecified

      public boolean isSpecified()
    • orElseIfUnspecified

      @NotNull public @NotNull Percentage orElseIfUnspecified(float value)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(@NotNull @NotNull Percentage o)
      Specified by:
      compareTo in interface Comparable<Percentage>