Package io.github.srcimon.screwbox.core
Class Percent
java.lang.Object
io.github.srcimon.screwbox.core.Percent
- All Implemented Interfaces:
Serializable
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd
(double value) Returns a new instance with the sum of both values.boolean
static Percent
half()
Returns 50 percent.int
hashCode()
invert()
boolean
boolean
static Percent
max()
Returns 100 percent.static Percent
min()
Returns 0 percent.multiply
(double value) Returns a new instance with the current value multiplied with the given value.static Percent
of
(double value) static Percent
quater()
Returns 25 percent.substract
(double value) Returns a new instance with the current value minus the given value.static Percent
Returns 75 percent.toString()
double
value()
-
Method Details
-
of
-
quater
Returns 25 percent. -
half
Returns 50 percent. -
threeQuarter
Returns 75 percent. -
min
Returns 0 percent. -
max
Returns 100 percent. -
value
public double value() -
isMinValue
public boolean isMinValue() -
isMaxValue
public boolean isMaxValue() -
toString
-
hashCode
public int hashCode() -
equals
-
invert
-
add
Returns a new instance with the sum of both values. Returnsmax()
when the sum is above 100 percent. -
substract
Returns a new instance with the current value minus the given value. Returnsmin()
when the sum is below 0 percent. -
multiply
Returns a new instance with the current value multiplied with the given value.
-