-
- All Known Implementing Classes:
CoreContainerDelegate
public interface DefaultDelegateAPIDefault delegate API for use as trait by delegate subclasses.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default doubleabs(double n)Calculate the absolute value of the given value.default doubleacos(double value)Returns the arc cosine of a value.default PArrayarray(String s)Parse the given String into aPArray.default PArrayarray(Property p)Attempt to extract aPArrayfrom the given Property.default PArrayarray(Value v)Convert the given Value into aPArray.default doubleasin(double value)Returns the arc sine of a value.default doubleatan(double value)Returns the arc tangent of a value.default doubleatan2(double y, double x)Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).default booleanb(String s)Parse the given String into a boolean according to the parsing rules ofPBoolean.default booleanb(Property p)Extract the Property's current value as a boolean.default booleanb(Value v)Convert the provided Value into a boolean according to the parsing rules ofPBoolean.default doubleconstrain(double amt, double low, double high)Constrain a value between the range of the given low and high values.default intconstrain(int amt, int low, int high)Constrain a value between the range of the given low and high values.default doublecos(double angle)Returns the trigonometric cosine of an angle.default doubled(String s)Parse the provided String into a double, or zero if invalid.default doubled(Property p)Extract a double from the Property's current Value, or zero if the value cannot be coerced.default doubled(Value v)Convert the provided Value into a double, or zero if the Value cannot be coerced.default doubledegrees(double radians)Converts an angle in radians to an angle in degrees.default doubledist(double x1, double y1, double x2, double y2)Calculates the distance between two points.default doubledist(double x1, double y1, double z1, double x2, double y2, double z2)Calculates the distance between two points.default doubleexp(double a)Calculate Euler's number raised to the power of the given value.default inti(String s)Parse the provided String into an int, or zero if invalid.default inti(Property p)Extract an int from the Property's current Value, or zero if the value cannot be coerced.default inti(Value v)Convert the provided Value into an int, or zero if the Value cannot be coerced.default doublelerp(double start, double stop, double amt)Calculates a number between two numbers at a specific increment.default doublelog(double a)Calculate the natural logarithm if the given value.default doublemap(double value, double start1, double stop1, double start2, double stop2)Re-map (scale) an input value from one range to another.default doublemax(double... values)Calculate the maximum value in the provided array.default doublemax(double a, double b)Calculate the maximum of two values.default doublemax(double a, double b, double c)Calculate the maximum of three values.default intmax(int... values)Calculate the maximum value in the provided array.default intmax(int a, int b)Calculate the maximum of two values.default intmax(int a, int b, int c)Calculate the maximum of three values.default doublemin(double... values)Calculate the minimum value in the provided array.default doublemin(double a, double b)Calculate the minimum of two values.default doublemin(double a, double b, double c)Calculate the minimum of three values.default intmin(int... values)Calculate the minimum value in the provided array.default intmin(int a, int b)Calculate the minimum of two values.default intmin(int a, int b, int c)Calculate the minimum of three values.default doublenorm(double value, double start, double stop)Normalizes a number from another range into a value between 0 and 1.default doublepow(double a, double b)Calculate the value of the first argument raised to the power of the second argument.default doubleradians(double degrees)Converts an angle in degrees to an angle in radians.default doublerandom(double max)Return a random number between zero and max (exclusive)default doublerandom(double min, double max)Return a random number between min (inclusive) and max (exclusive)default doublerandomOf(double... values)Return a random element from an array of values.default intrandomOf(int... values)Return a random element from an array of values.default StringrandomOf(String... values)Return a random element from an array of values.default intround(double amt)Round a value to the nearest integer.default Strings(Property p)Extract the Property's current value into a String representation.default Strings(Value v)Convert the provided Value into a String representation.default doublesin(double angle)Returns the trigonometric sine of an angledefault doublesq(double a)Calculate the square of the given value.default doublesqrt(double a)Calculate the square root of the given value.default doubletan(double angle)Returns the trigonometric tangent of an angle.
-
-
-
Method Detail
-
d
default double d(Property p)
Extract a double from the Property's current Value, or zero if the value cannot be coerced.- Parameters:
p-- Returns:
-
d
default double d(Value v)
Convert the provided Value into a double, or zero if the Value cannot be coerced.- Parameters:
v-- Returns:
-
d
default double d(String s)
Parse the provided String into a double, or zero if invalid.- Parameters:
s-- Returns:
-
i
default int i(Property p)
Extract an int from the Property's current Value, or zero if the value cannot be coerced.- Parameters:
p-- Returns:
-
i
default int i(Value v)
Convert the provided Value into an int, or zero if the Value cannot be coerced.- Parameters:
v-- Returns:
-
i
default int i(String s)
Parse the provided String into an int, or zero if invalid.- Parameters:
s-- Returns:
-
b
default boolean b(Property p)
Extract the Property's current value as a boolean. If the value cannot be coerced, returns false.- Parameters:
p-- Returns:
-
b
default boolean b(Value v)
Convert the provided Value into a boolean according to the parsing rules ofPBoolean. If the Value cannot be coerced, returns false.- Parameters:
v-- Returns:
-
b
default boolean b(String s)
Parse the given String into a boolean according to the parsing rules ofPBoolean. If the String is invalid, returns false.- Parameters:
s-- Returns:
-
s
default String s(Property p)
Extract the Property's current value into a String representation.- Parameters:
p-- Returns:
-
s
default String s(Value v)
Convert the provided Value into a String representation.- Parameters:
v-- Returns:
-
array
default PArray array(Property p)
Attempt to extract aPArrayfrom the given Property. An empty PArray will be returned if the property's value is not a PArray and cannot be coerced.- Parameters:
p-- Returns:
- See Also:
array(org.praxislive.core.types.Value)
-
array
default PArray array(Value v)
Convert the given Value into aPArray. If the Value is already a PArray it will be returned, otherwise an attempt will be made to coerce it. If the Value cannot be converted, an empty PArray will be returned.- Parameters:
s-- Returns:
-
array
default PArray array(String s)
Parse the given String into aPArray. If the String is not a valid representation of an array, returns an empty PArray.- Parameters:
s-- Returns:
-
random
default double random(double max)
Return a random number between zero and max (exclusive)- Parameters:
max- the upper bound of the range- Returns:
-
random
default double random(double min, double max)Return a random number between min (inclusive) and max (exclusive)- Parameters:
min- the lower bound of the rangemax- the upper bound of the range- Returns:
-
randomOf
default double randomOf(double... values)
Return a random element from an array of values.- Parameters:
values- list of values, may not be empty- Returns:
- random element
-
randomOf
default int randomOf(int... values)
Return a random element from an array of values.- Parameters:
values- list of values, may not be empty- Returns:
- random element
-
randomOf
default String randomOf(String... values)
Return a random element from an array of values.- Parameters:
values- list of values, may not be empty- Returns:
- random element
-
abs
default double abs(double n)
Calculate the absolute value of the given value. If the value is positive, the value is returned. If the value is negative, the negation of the value is returned.- Parameters:
n-- Returns:
-
sq
default double sq(double a)
Calculate the square of the given value.- Parameters:
a-- Returns:
-
sqrt
default double sqrt(double a)
Calculate the square root of the given value.- Parameters:
a-- Returns:
- See Also:
Math.sqrt(double)
-
log
default double log(double a)
Calculate the natural logarithm if the given value.- Parameters:
a-- Returns:
- See Also:
Math.log(double)
-
exp
default double exp(double a)
Calculate Euler's number raised to the power of the given value.- Parameters:
a-- Returns:
- See Also:
Math.exp(double)
-
pow
default double pow(double a, double b)Calculate the value of the first argument raised to the power of the second argument.- Parameters:
a- the baseb- the exponent- Returns:
- the value ab
- See Also:
Math.pow(double, double)
-
max
default int max(int a, int b)Calculate the maximum of two values.- Parameters:
a-b-- Returns:
-
max
default int max(int a, int b, int c)Calculate the maximum of three values.- Parameters:
a-b-c-- Returns:
-
max
default int max(int... values)
Calculate the maximum value in the provided array.- Parameters:
values- value list - must not be empty- Returns:
- maximum value
-
max
default double max(double a, double b)Calculate the maximum of two values.- Parameters:
a-b-- Returns:
-
max
default double max(double a, double b, double c)Calculate the maximum of three values.- Parameters:
a-b-c-- Returns:
-
max
default double max(double... values)
Calculate the maximum value in the provided array.- Parameters:
values- value list - must not be empty- Returns:
- maximum value
-
min
default int min(int a, int b)Calculate the minimum of two values.- Parameters:
a-b-- Returns:
-
min
default int min(int a, int b, int c)Calculate the minimum of three values.- Parameters:
a-b-c-- Returns:
-
min
default int min(int... values)
Calculate the minimum value in the provided array.- Parameters:
values- value list - must not be empty- Returns:
- minimum value
-
min
default double min(double a, double b)Calculate the minimum of two values.- Parameters:
a-b-- Returns:
-
min
default double min(double a, double b, double c)Calculate the minimum of three values.- Parameters:
a-b-c-- Returns:
-
min
default double min(double... values)
Calculate the minimum value in the provided array.- Parameters:
values- value list - must not be empty- Returns:
- minimum value
-
constrain
default int constrain(int amt, int low, int high)Constrain a value between the range of the given low and high values.- Parameters:
amt- input valuelow- lowest allowed valuehigh- highest allowed value- Returns:
- constrained value
-
constrain
default double constrain(double amt, double low, double high)Constrain a value between the range of the given low and high values.- Parameters:
amt- input valuelow- lowest allowed valuehigh- highest allowed value- Returns:
- constrained value
-
round
default int round(double amt)
Round a value to the nearest integer.- Parameters:
amt- input value- Returns:
- rounded value
-
degrees
default double degrees(double radians)
Converts an angle in radians to an angle in degrees.- Parameters:
radians-- Returns:
- See Also:
Math.toDegrees(double)
-
radians
default double radians(double degrees)
Converts an angle in degrees to an angle in radians.- Parameters:
degrees-- Returns:
- See Also:
Math.toRadians(double)
-
sin
default double sin(double angle)
Returns the trigonometric sine of an angle- Parameters:
angle-- Returns:
- See Also:
Math.sin(double)
-
cos
default double cos(double angle)
Returns the trigonometric cosine of an angle.- Parameters:
angle-- Returns:
- See Also:
Math.cos(double)
-
tan
default double tan(double angle)
Returns the trigonometric tangent of an angle.- Parameters:
angle-- Returns:
- See Also:
Math.tan(double)
-
asin
default double asin(double value)
Returns the arc sine of a value.- Parameters:
value-- Returns:
- See Also:
Math.asin(double)
-
acos
default double acos(double value)
Returns the arc cosine of a value.- Parameters:
value-- Returns:
- See Also:
Math.acos(double)
-
atan
default double atan(double value)
Returns the arc tangent of a value.- Parameters:
value-- Returns:
- See Also:
Math.atan(double)
-
atan2
default double atan2(double y, double x)Returns the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).- Parameters:
y-x-- Returns:
- See Also:
Math.atan2(double, double)
-
map
default double map(double value, double start1, double stop1, double start2, double stop2)Re-map (scale) an input value from one range to another. Numbers outside the range are not clamped.- Parameters:
value- the value to be convertedstart1- lower bound of the value's current rangestop1- upper bound of the value's current rangestart2- lower bound of the value's target rangestop2- upper bound of the value's target range- Returns:
-
dist
default double dist(double x1, double y1, double x2, double y2)Calculates the distance between two points.- Parameters:
x1- x-coordinate of the first pointy1- y-coordinate of the first pointx2- x-coordinate of the second pointy2- y-coordinate of the second point- Returns:
-
dist
default double dist(double x1, double y1, double z1, double x2, double y2, double z2)Calculates the distance between two points.- Parameters:
x1- x-coordinate of the first pointy1- y-coordinate of the first pointz1- z-coordinate of the first pointx2- x-coordinate of the second pointy2- y-coordinate of the second pointz2- z-coordinate of the second point- Returns:
-
lerp
default double lerp(double start, double stop, double amt)Calculates a number between two numbers at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc. The lerp function is convenient for creating motion along a straight path and for drawing dotted lines.- Parameters:
start- first valuestop- second valueamt- between 0.0 and 1.0- Returns:
-
norm
default double norm(double value, double start, double stop)Normalizes a number from another range into a value between 0 and 1.Identical to map(value, low, high, 0, 1);
Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.
- Parameters:
value- the incoming value to be convertedstart- lower bound of the value's current rangestop- upper bound of the value's current range- Returns:
-
-