XPRMProcedure
- java.lang.Object
-
- com.dashoptimization.XPRMProcedure
-
- All Implemented Interfaces:
- XPRMIdentifier, XPRMTyped
public class XPRMProcedure extends java.lang.Object
A procedure or function supplied by a module or implemented in a model.
-
-
Field Summary
-
Fields inherited from interface com.dashoptimization.XPRMTyped
GRP_DYN, GRP_GEN, MSK_FIN, MSK_GRP, MSK_STR, MSK_TYP, STR_ARRAY, STR_CONST, 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
-
-
Method Summary
Modifier and Type Method and Description XPRMLocation
findLocation()
Find the location of the procedure in the source.java.lang.String
getName()
Get the identifier name.int
getNbParameters()
Get the number of parameters (arguments) expected by the subroutine.java.lang.String
getParameterTypes()
Get the string of parameter types.int
getStructCode()
Structure code.java.lang.String
getStructName()
String representation of structure.int
getTypeCode()
Type code.java.lang.String
getTypeName()
String representation of type.XPRMProcedure
next()
Get the next overloaded version of the subroutine (model routine only).
-
-
-
Method Detail
-
getNbParameters
public int getNbParameters()
Get the number of parameters (arguments) expected by the subroutine.- Returns:
- Number of parameters
-
getParameterTypes
public java.lang.String getParameterTypes()
Get the string of parameter types. This is a text string describing which arguments are expected by the function: it is its signature. This string is composed with the following characters:i
an integer;r
a real;s
a text string;b
a Boolean;v
a decision variable (type mpvar);c
a linear constraint (type linctr);I
a range set;a
an array (of any kind);e
a set (of any type);|xxx|
external type named 'xxx';!xxx!
the set named 'xxx';Andx.t
an array indexed by 'ndx' of the type 't'. 'ndx' is a string describing the type of each indexing set. 'ndx' may be omitted, in which case any array of type 't' is a valid parameter;Et
a set of type 't'.
proc(n:integer, tab:array(range, set of real, myset) of string, flag:boolean)
has the signature'iAIr!myset!.sb'
.- Returns:
- String describing type of parameters
-
next
public XPRMProcedure next()
Get the next overloaded version of the subroutine (model routine only). A subroutine may be defined several times in a model with different sets of arguments. This function gives access to all the defined overloaded versions of a subroutine.- Returns:
-
The next procedure or
null
if the procedure is not overloaded or comes from a module
-
findLocation
public XPRMLocation findLocation()
Find the location of the procedure in the source.- Returns:
-
The location of the procedure or
null
if no debugging information is available or the procedure comes from a module
-
getStructCode
public final int getStructCode()
Description copied from interface:XPRMTyped
Structure code. The code is one of theSTR_*
values.- Returns:
- Encoded structure
-
getStructName
public final java.lang.String getStructName()
Description copied from interface:XPRMTyped
String representation of structure.- Returns:
- Structure name
-
getTypeName
public final java.lang.String getTypeName()
Description copied from interface:XPRMTyped
String representation of type.- Specified by:
-
getTypeName
in interfaceXPRMTyped
- Returns:
- Type name
-
getTypeCode
public final int getTypeCode()
Description copied from interface:XPRMTyped
Type code. The code is one of theTYP_*
values.- Specified by:
-
getTypeCode
in interfaceXPRMTyped
- Returns:
- Encoded type
-
getName
public java.lang.String getName()
Description copied from interface:XPRMIdentifier
Get the identifier name.- Specified by:
-
getName
in interfaceXPRMIdentifier
- Returns:
- The identifier name
-
-