Class Dimension.If
java.lang.Object
dev.prozilla.pine.common.math.dimension.DimensionBase
dev.prozilla.pine.common.math.dimension.DimensionComparator
dev.prozilla.pine.common.math.dimension.Dimension.If
- All Implemented Interfaces:
Cloneable<DimensionBase>
,Printable
- Enclosing class:
Dimension
-
Field Summary
FieldsFields inherited from class dev.prozilla.pine.common.math.dimension.DimensionComparator
dimensionA, dimensionB, isDirty
Fields inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
computedValue, DEFAULT_DIRTY
-
Constructor Summary
ConstructorsConstructorDescriptionIf
(boolean predicate, DimensionBase dimensionTrue, DimensionBase dimensionFalse) Creates a function that returns value ofdimensionTrue
if predicate istrue
, otherwise returns value ofdimensionFalse
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this dimension.protected int
compare
(int valueA, int valueB) Compares the values of both dimensions stored in this comparator.boolean
equals
(DimensionBase dimensionBase) Checks whether this dimension is equal to a given dimension.boolean
void
setPredicate
(boolean predicate) toString()
Returns the string representation of this dimension.Methods inherited from class dev.prozilla.pine.common.math.dimension.DimensionComparator
has, isDirty, recompute
Methods inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
compute, equals, getUnit, hashCode
-
Field Details
-
predicate
protected boolean predicate
-
-
Constructor Details
-
If
Creates a function that returns value ofdimensionTrue
if predicate istrue
, otherwise returns value ofdimensionFalse
.
-
-
Method Details
-
compare
protected int compare(int valueA, int valueB) Description copied from class:DimensionComparator
Compares the values of both dimensions stored in this comparator.- Specified by:
compare
in classDimensionComparator
- Returns:
- The result of this comparator function.
-
clone
Description copied from class:DimensionBase
Returns a clone of this dimension.- Specified by:
clone
in interfaceCloneable<DimensionBase>
- Specified by:
clone
in classDimensionBase
- Returns:
- New dimension instance
-
equals
Description copied from class:DimensionBase
Checks whether this dimension is equal to a given dimension.- Specified by:
equals
in interfaceCloneable<DimensionBase>
- Overrides:
equals
in classDimensionComparator
- Parameters:
dimensionBase
- Other dimension- Returns:
true
if both objects are equal.
-
getPredicate
public boolean getPredicate() -
setPredicate
public void setPredicate(boolean predicate) -
toString
Description copied from class:DimensionBase
Returns the string representation of this dimension.- Specified by:
toString
in interfacePrintable
- Specified by:
toString
in classDimensionBase
- Returns:
- String representation of this object.
-