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 theEOFtoken.- Since:
- 43.00
-
-
Field Summary
Modifier and Type Field Description static TokenABSabsfunction.static TokenARCCOSarccosfunction.static TokenARCSINarcsinfunction.static TokenARCTANarctanfunction.static TokenCOLONColon token.static TokenCOMMAComma token.static TokenCOScosfunction.static TokenDIVIDEDivide token.static TokenEOFEnd of formula token.static TokenEXPexpfunction.static TokenEXPONENTExponentiation token.static TokenLBLeft-bracket token.static TokenLNlnfunction.static TokenLOG10log10function.static TokenMAXmaxfunction.static TokenMINminfunction.static TokenMINUSMinus token.static TokenMULTIPLYMultiply token.static TokenPLUSPlus token.static TokenPRODprodfunction.static TokenPWLpwlfunction.static TokenRBRight-bracket token.static TokenSIGNsignfunction.static TokenSINsinfunction.static TokenSQRTsqrtfunction.static TokenSUMsumfunction.static TokenTANtanfunction.static TokenUMINUSUnary minus token.
-
Method Summary
Modifier and Type Method Description static Tokencolumn(int col)Create a token that represents a reference to columncol.intcompareTo(Token other)static Tokenconstant(double value)Create a token that represents the constant valuevalue.booleanequals(Token other)booleanequals(java.lang.Object other)static Tokenfunction(int id)Create a token that represents a call to user functionid.intgetType()doublegetValue()inthashCode()static TokeninternalFunction(int id)Create a token that represents a call to internal functionid.static Tokenof(int type, double value)Create a token from a type and a value.java.lang.StringtoString()
-
-
-
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
log10function.- Since:
- 43.00
-
LN
public static final Token LN
lnfunction.- Since:
- 43.00
-
EXP
public static final Token EXP
expfunction.- Since:
- 43.00
-
ABS
public static final Token ABS
absfunction.- Since:
- 43.00
-
SQRT
public static final Token SQRT
sqrtfunction.- Since:
- 43.00
-
SIN
public static final Token SIN
sinfunction.- Since:
- 43.00
-
COS
public static final Token COS
cosfunction.- Since:
- 43.00
-
TAN
public static final Token TAN
tanfunction.- Since:
- 43.00
-
ARCSIN
public static final Token ARCSIN
arcsinfunction.- Since:
- 43.00
-
ARCCOS
public static final Token ARCCOS
arccosfunction.- Since:
- 43.00
-
ARCTAN
public static final Token ARCTAN
arctanfunction.- Since:
- 43.00
-
MIN
public static final Token MIN
minfunction.- Since:
- 43.00
-
MAX
public static final Token MAX
maxfunction.- Since:
- 43.00
-
PWL
public static final Token PWL
pwlfunction.- Since:
- 43.00
-
SUM
public static final Token SUM
sumfunction.- Since:
- 43.00
-
PROD
public static final Token PROD
prodfunction.- Since:
- 43.00
-
SIGN
public static final Token SIGN
signfunction.- Since:
- 43.00
-
-
Method Detail
-
getType
public int getType()
-
getValue
public double getValue()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
-
equalsin 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:
-
compareToin interfacejava.lang.Comparable<Token> - Parameters:
-
other- - Returns:
- Since:
- 43.00
-
hashCode
public int hashCode()
- Overrides:
-
hashCodein classjava.lang.Object - Returns:
- Since:
- 43.00
-
constant
public static Token constant(double value)
Create a token that represents the constant valuevalue.Examples using
constant:- 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.Examples using
of:- Parameters:
-
type- Token type. -
value- Token value. - Returns:
-
The token represented by
typeandvalue. - Since:
- 43.00
-
toString
public java.lang.String toString()
- Overrides:
-
toStringin 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.
