Token
- java.lang.Object
-
- com.dashoptimization.objects.Token
-
- All Implemented Interfaces:
-
java.lang.Comparable<Token>
public final class Token extends java.lang.Object implements java.lang.Comparable<Token>
A token in a non-linear formula. All constructors of this class are private. Use the various static factory functions to get new instances. This avoids creating multiple instances that refer to the same token (like for example theEOF
token.- Since:
- 43.00
-
-
Field Summary
Modifier and Type Field Description static Token
ABS
abs
function.static Token
ARCCOS
arccos
function.static Token
ARCSIN
arcsin
function.static Token
ARCTAN
arctan
function.static Token
COLON
Colon token.static Token
COMMA
Comma token.static Token
COS
cos
function.static Token
DIVIDE
Divide token.static Token
EOF
End of formula token.static Token
EXP
exp
function.static Token
EXPONENT
Exponentiation token.static Token
LB
Left-bracket token.static Token
LN
ln
function.static Token
LOG10
log10
function.static Token
MAX
max
function.static Token
MIN
min
function.static Token
MINUS
Minus token.static Token
MULTIPLY
Multiply token.static Token
PLUS
Plus token.static Token
PROD
prod
function.static Token
PWL
pwl
function.static Token
RB
Right-bracket token.static Token
SIGN
sign
function.static Token
SIN
sin
function.static Token
SQRT
sqrt
function.static Token
SUM
sum
function.static Token
TAN
tan
function.static Token
UMINUS
Unary minus token.
-
Method Summary
Modifier and Type Method Description static Token
column(int col)
Create a token that represents a reference to columncol
.int
compareTo(Token other)
static Token
constant(double value)
Create a token that represents the constant valuevalue
.boolean
equals(Token other)
boolean
equals(java.lang.Object other)
static Token
function(int id)
Create a token that represents a call to user functionid
.int
getType()
double
getValue()
int
hashCode()
static Token
internalFunction(int id)
Create a token that represents a call to internal functionid
.static Token
of(int type, double value)
Create a token from a type and a value.java.lang.String
toString()
-
-
-
Field Detail
-
EOF
public static final Token EOF
End of formula token.- Since:
- 43.00
-
LB
public static final Token LB
Left-bracket token.- Since:
- 43.00
-
RB
public static final Token RB
Right-bracket token.- Since:
- 43.00
-
UMINUS
public static final Token UMINUS
Unary minus token.- Since:
- 43.00
-
EXPONENT
public static final Token EXPONENT
Exponentiation token.- Since:
- 43.00
-
MULTIPLY
public static final Token MULTIPLY
Multiply token.- Since:
- 43.00
-
DIVIDE
public static final Token DIVIDE
Divide token.- Since:
- 43.00
-
PLUS
public static final Token PLUS
Plus token.- Since:
- 43.00
-
MINUS
public static final Token MINUS
Minus token.- Since:
- 43.00
-
COMMA
public static final Token COMMA
Comma token.- Since:
- 43.00
-
COLON
public static final Token COLON
Colon token.- Since:
- 43.00
-
LOG10
public static final Token LOG10
log10
function.- Since:
- 43.00
-
LN
public static final Token LN
ln
function.- Since:
- 43.00
-
EXP
public static final Token EXP
exp
function.- Since:
- 43.00
-
ABS
public static final Token ABS
abs
function.- Since:
- 43.00
-
SQRT
public static final Token SQRT
sqrt
function.- Since:
- 43.00
-
SIN
public static final Token SIN
sin
function.- Since:
- 43.00
-
COS
public static final Token COS
cos
function.- Since:
- 43.00
-
TAN
public static final Token TAN
tan
function.- Since:
- 43.00
-
ARCSIN
public static final Token ARCSIN
arcsin
function.- Since:
- 43.00
-
ARCCOS
public static final Token ARCCOS
arccos
function.- Since:
- 43.00
-
ARCTAN
public static final Token ARCTAN
arctan
function.- Since:
- 43.00
-
MIN
public static final Token MIN
min
function.- Since:
- 43.00
-
MAX
public static final Token MAX
max
function.- Since:
- 43.00
-
PWL
public static final Token PWL
pwl
function.- Since:
- 43.00
-
SUM
public static final Token SUM
sum
function.- Since:
- 43.00
-
PROD
public static final Token PROD
prod
function.- Since:
- 43.00
-
SIGN
public static final Token SIGN
sign
function.- Since:
- 43.00
-
-
Method Detail
-
getType
public int getType()
-
getValue
public double getValue()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
-
equals
in classjava.lang.Object
- Parameters:
-
other
- - Returns:
- Since:
- 43.00
-
equals
public boolean equals(Token other)
- Parameters:
-
other
- - Returns:
- Since:
- 43.00
-
compareTo
public int compareTo(Token other)
- Specified by:
-
compareTo
in interfacejava.lang.Comparable<Token>
- Parameters:
-
other
- - Returns:
- Since:
- 43.00
-
hashCode
public int hashCode()
- Overrides:
-
hashCode
in classjava.lang.Object
- Returns:
- Since:
- 43.00
-
constant
public static Token constant(double value)
Create a token that represents the constant valuevalue
.- Parameters:
-
value
- Constant value that the new token represents. - Returns:
- The new token.
- Since:
- 43.00
-
column
public static Token column(int col)
Create a token that represents a reference to columncol
.- Parameters:
-
col
- Index of column to reference. - Returns:
- The new token.
- Since:
- 43.00
-
function
public static Token function(int id)
Create a token that represents a call to user functionid
.- Parameters:
-
id
- User function id. - Returns:
- The new token.
- Since:
- 43.00
-
internalFunction
public static Token internalFunction(int id)
Create a token that represents a call to internal functionid
.- Parameters:
-
id
- Internal function id. - Returns:
- The new token.
- Since:
- 43.00
-
of
public static Token of(int type, double value)
Create a token from a type and a value.- Parameters:
-
type
- Token type. -
value
- Token value. - Returns:
-
The token represented by
type
andvalue
. - Since:
- 43.00
-
toString
public java.lang.String toString()
- Overrides:
-
toString
in classjava.lang.Object
- Returns:
- Since:
- 43.00
-
-
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.