Class ResolvedBound
- All Implemented Interfaces:
Serializable
A bound resolved into pixel units.
This class represents a bound with minimum and maximum values, typically used after resolving a bound into pixel units.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionResolvedBound
(double min, double max) Creates a new instance by copying another ResolvedBound. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double val) Checks if a value is contained within the bound.getDscr()
Gets a description of the bound.double
getMax()
double
getMin()
double
randOpen
(RandomNumberGenerator randomNumberGenerator) Generates a random value between the bounds (open interval).void
scale
(double multFactor) Scales the bound by a multiplication factor.void
setMax
(double max) void
setMin
(double min) toString()
By default, we useAnchorBean.describeBean()
as the string representation of the bean.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
-
Constructor Details
-
ResolvedBound
Creates a new instance by copying another ResolvedBound.- Parameters:
src
- the source ResolvedBound to copy from
-
ResolvedBound
public ResolvedBound() -
ResolvedBound
public ResolvedBound(double min, double max)
-
-
Method Details
-
contains
public boolean contains(double val) Checks if a value is contained within the bound.- Parameters:
val
- the value to check- Returns:
- true if the value is within the bound, false otherwise
-
getDscr
Gets a description of the bound.- Returns:
- a string description of the bound
-
scale
public void scale(double multFactor) Scales the bound by a multiplication factor.- Parameters:
multFactor
- the factor to multiply the bound values by
-
randOpen
Generates a random value between the bounds (open interval).- Parameters:
randomNumberGenerator
- the random number generator to use- Returns:
- a random value between min and max
-
toString
Description copied from class:AnchorBean
By default, we useAnchorBean.describeBean()
as the string representation of the bean.- Overrides:
toString
in classAnchorBean<ResolvedBound>
- Returns:
- the string representation
-
getMin
public double getMin() -
setMin
public void setMin(double min) -
getMax
public double getMax() -
setMax
public void setMax(double max)
-