Class Dimension.Clamp
java.lang.Object
dev.prozilla.pine.common.math.dimension.DimensionBase
dev.prozilla.pine.common.math.dimension.Dimension.Clamp
- All Implemented Interfaces:
Cloneable<DimensionBase>,Printable
- Enclosing class:
Dimension
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
computedValue, DEFAULT_DIRTY -
Constructor Summary
ConstructorsConstructorDescriptionClamp(DimensionBase dimension, DimensionBase dimensionMin, DimensionBase dimensionMax) Creates a function that returns the value of a dimension, clamped between the values of two dimensions. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this dimension.booleanequals(DimensionBase dimensionBase) Checks whether this dimension is equal to a given dimension.booleanequals(DimensionBase dimension, DimensionBase dimensionMin, DimensionBase dimensionMax) booleanChecks whether this dimension has been modified since the last calculation.protected floatRecalculates the value of this dimension when it has been marked as dirty.@NotNull StringtoString()Returns the string representation of this dimension.Methods inherited from class dev.prozilla.pine.common.math.dimension.DimensionBase
compute, equals, getUnit, hashCode
-
Constructor Details
-
Clamp
Creates a function that returns the value of a dimension, clamped between the values of two dimensions.
-
-
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.
-
clone
Description copied from class:DimensionBaseReturns a clone of this dimension.- Specified by:
clonein interfaceCloneable<DimensionBase>- Specified by:
clonein classDimensionBase- Returns:
- New dimension instance
-
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.
-
equals
public boolean equals(DimensionBase dimension, DimensionBase dimensionMin, DimensionBase dimensionMax) -
toString
Description copied from class:DimensionBaseReturns the string representation of this dimension.- Specified by:
toStringin interfacePrintable- Specified by:
toStringin classDimensionBase- Returns:
- String representation of this object.
-