public class JiffleFunctions extends Object
AbstractJiffleRuntime
.Constructor and Description |
---|
JiffleFunctions() |
Modifier and Type | Method and Description |
---|---|
double |
AND(double x,
double y)
Tests if both x and y are non-zero.
|
List |
concatDL(double x,
List list)
Creates a new list by concatenating {2code x} and
list . |
List |
concatLD(List list,
double x)
Creates a new list by concatenating
list and {2code x}. |
List |
concatLL(List list1,
List list2)
Creates a new list by concatenating two existing lists.
|
double |
degToRad(double x)
Converts an angle in degrees to radians.
|
double |
EQ(double x,
double y)
Tests if x is equal to y.
|
double |
GE(double x,
double y)
Tests if x is greater than or equal to y.
|
double |
GT(double x,
double y)
Tests if x is greater than y.
|
double |
isinf(double x)
Tests if x is infinite (equal to Double.POSITIVE_INFINITY or
Double.NEGATIVE_INFINITY).
|
double |
isnan(double x)
Tests if x is equal to Double.NaN.
|
double |
isnull(double x)
Tests if x is null.
|
boolean |
isTrue(Double x)
Returns true if x is non zero and non null
|
double |
LE(double x,
double y)
Tests if x is less than or equal to y.
|
double |
log2Arg(double x,
double b)
Gets the log of x to base b.
|
double |
LT(double x,
double y)
Tests if x is less than y.
|
double |
max(List values)
Gets the maximum of the input values.
|
double |
mean(List values)
Gets the mean of the input values.
|
double |
median(List values)
Gets the median of the input values.
|
double |
min(List values)
Gets the minimum of the input values.
|
double |
mode(List values)
Gets the mode of the input values.
|
double |
NE(double x,
double y)
Tests if x is not equal to y.
|
double |
NOT(double x)
Treats x as true if non-zero, or false if zero and then
returns the logical complement.
|
double |
OR(double x,
double y)
Tests if either x or y is non-zero.
|
double |
radToDeg(double x)
Converts an angle in radians to degrees.
|
double |
rand(double x)
Gets a random value between 0 (inclusive) and x (exclusive).
|
double |
randInt(double x)
Gets a random integer value (actually a truncated double) between
0 (inclusive) and
floor(x) (exclusive). |
double |
range(List values)
Gets the range of the input values.
|
double |
round2Arg(double x,
double prec)
Rounds the input value to the given precision.
|
double |
sdev(List values)
Gets the sample standard deviation of the input values.
|
Integer |
sign(double x)
Return the sign of
x as an integer. |
double |
sum(List values)
Gets the sum of the input values.
|
double |
variance(List values)
Gets the sample variance of the input values.
|
double |
XOR(double x,
double y)
Tests if just one of x or y is non-zero.
|
public double degToRad(double x)
x
- input angle in degreespublic Integer sign(double x)
x
as an integer. This method is used
by Jiffle to implement its various if
functions.
x
- test valuenull
if x is NaNpublic double isinf(double x)
x
- test valueDouble.Nan
if x is Double.Nan
public double isnan(double x)
x
- test valuepublic double isnull(double x)
isnan(double)
.x
- the test valuepublic double log2Arg(double x, double b)
x
- the valueb
- the basepublic double max(List values)
values
- the input valuespublic double mean(List values)
values
- the input valuespublic double median(List values)
values
- the input valuespublic double min(List values)
values
- the input valuespublic double mode(List values)
values
- the input valuespublic double radToDeg(double x)
x
- input angle in radianspublic double rand(double x)
x
- upper limitpublic double randInt(double x)
floor(x)
(exclusive).x
- upper limitpublic double range(List values)
values
- the input valuespublic double round2Arg(double x, double prec)
x
- the input valueprec
- the desired precisionpublic double sdev(List values)
values
- the input valuespublic double sum(List values)
values
- the input valuespublic double variance(List values)
values
- the input valuespublic double OR(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double AND(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double XOR(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double GT(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double GE(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double LT(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double LE(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double EQ(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double NE(double x, double y)
x
- x valuey
- y valueDouble.Nan
if either x or y is Double.Nan
public double NOT(double x)
x
- the test valueDouble.Nan
if x is Double.Nan
public List concatDL(double x, List list)
list
.x
- the valuelist
- the listpublic List concatLD(List list, double x)
list
and {2code x}.list
- the listx
- the valuepublic List concatLL(List list1, List list2)
list1
- the first listlist2
- the second listpublic boolean isTrue(Double x)
Copyright © 2006–2018 GeoSolutions. All rights reserved.