Class DimensionComparator
java.lang.Object
dev.prozilla.pine.common.math.dimension.DimensionBase
dev.prozilla.pine.common.math.dimension.DimensionComparator
- All Implemented Interfaces:
Cloneable<DimensionBase>,Printable
- Direct Known Subclasses:
Dimension.Add,Dimension.If,Dimension.Max,Dimension.Min,Dimension.Mix,Dimension.Multiply,Dimension.Subtract
Abstract class for a function that compares two dimensions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DimensionBaseprotected final DimensionBaseprotected booleanFields inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
computedValue, DEFAULT_DIRTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract floatcompare(float valueA, float valueB) Compares the values of both dimensions stored in this comparator.booleanequals(DimensionBase dimensionBase) Checks whether this dimension is equal to a given dimension.booleanhas(DimensionBase dimension) booleanChecks whether this dimension has been modified since the last calculation.protected final floatRecalculates the value of this dimension when it has been marked as dirty.Methods inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
clone, compute, equals, getUnit, hashCode, toString
-
Field Details
-
dimensionA
-
dimensionB
-
isDirty
protected boolean isDirty
-
-
Constructor Details
-
DimensionComparator
-
-
Method Details
-
isDirty
Description copied from class:DimensionBaseChecks whether this dimension has been modified since the last calculation.- Overrides:
isDirtyin classDimensionBase- Returns:
- True if this dimension has been modified.
-
recompute
Description copied from class:DimensionBaseRecalculates the value of this dimension when it has been marked as dirty.- Specified by:
recomputein classDimensionBase- Parameters:
node- UI element, serving as the context of this dimension.- Returns:
- The computed value of this dimension in pixels.
-
has
-
equals
Description copied from class:DimensionBaseChecks whether this dimension is equal to a given dimension.- Specified by:
equalsin interfaceCloneable<DimensionBase>- Specified by:
equalsin classDimensionBase- Parameters:
dimensionBase- Other dimension- Returns:
trueif both objects are equal.
-
compare
protected abstract float compare(float valueA, float valueB) Compares the values of both dimensions stored in this comparator.- Returns:
- The result of this comparator function.
-