XPRMConstant
- java.lang.Object
-
- com.dashoptimization.XPRMConstant
-
- All Implemented Interfaces:
- XPRMIdentifier, XPRMTyped
public abstract class XPRMConstant extends java.lang.Object implements XPRMIdentifier
A constant in Mosel.
-
-
Field Summary
-
Fields inherited from interface com.dashoptimization.XPRMTyped
GRP_DYN, GRP_GEN, MSK_FIX, MSK_GRP, MSK_STR, MSK_TYP, STR_ARRAY, STR_CONST, STR_CSREF, STR_LIST, STR_MEM, STR_NTYP, STR_PROB, STR_PROC, STR_REC, STR_REF, STR_SET, STR_UTYP, TYP_BOOL, TYP_EXTN, TYP_INT, TYP_LINCTR, TYP_MPVAR, TYP_NOT, TYP_REAL, TYP_STRING
-
-
Constructor Summary
Constructor and Description XPRMConstant()
-
Method Summary
Modifier and Type Method and Description boolean
asBoolean()
A Boolean.int
asInteger()
An integer.double
asReal()
A real.java.lang.String
asString()
A string.int
getStructCode()
Structure code.java.lang.String
getStructName()
String representation of structure.abstract java.lang.String
toString()
String representation of the constant.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.dashoptimization.XPRMIdentifier
getName
-
Methods inherited from interface com.dashoptimization.XPRMTyped
getTypeCode, getTypeName
-
-
-
-
Method Detail
-
asInteger
public int asInteger()
An integer. This function is defined if the constant is an integer.- Returns:
- The integer value
-
asReal
public double asReal()
A real. This function is defined if the constant is a real.- Returns:
- The real value
-
asBoolean
public boolean asBoolean()
A Boolean. This function is defined if the constant is a Boolean.- Returns:
- The Boolean value
-
asString
public java.lang.String asString()
A string. This function is defined if the constant is a string.- Returns:
- The string value
-
getStructCode
public final int getStructCode()
Description copied from interface:XPRMTyped
Structure code. The code is one of theSTR_*
values.- Specified by:
-
getStructCode
in interfaceXPRMTyped
- Returns:
- Encoded structure
-
getStructName
public final java.lang.String getStructName()
Description copied from interface:XPRMTyped
String representation of structure.- Specified by:
-
getStructName
in interfaceXPRMTyped
- Returns:
- Structure name
-
toString
public abstract java.lang.String toString()
String representation of the constant.- Overrides:
-
toString
in classjava.lang.Object
- Returns:
- String corresponding to the value
-
-