XPRMSet
- java.lang.Object
-
- com.dashoptimization.XPRMValue
-
- com.dashoptimization.XPRMSet
-
-
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_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 XPRMSet
asSet()
A set.XPRMValue
get(int index)
Get the element associated to the given index.boolean
getAsBoolean(int index)
Get the element associated to the given index (set of Booleans).int
getAsInteger(int index)
Get the element associated to the given index (set of integers).double
getAsReal(int index)
Get the element associated to the given index (set of reals).java.lang.String
getAsString(int index)
Get the element associated to the given index (set of strings).int
getFirstIndex()
Get the index of the first element in the set.int
getIndex(boolean b)
Get the index of the given element (set of Booleans).int
getIndex(double r)
Get the index of the given element (set of reals).int
getIndex(int i)
Get the index of the given element (set of integers).int
getIndex(java.lang.String s)
Get the index of the given element (set of strings).abstract int
getIndex(XPRMValue v)
Get the index of the given element.int
getLastIndex()
Get the index of the last element in the set.int
getSize()
Get set size.int
getStructCode()
Structure code.java.lang.String
getStructName()
String representation of structure.int
getTypeCode()
Type code.java.lang.String
getTypeName()
String representation of type.boolean
isDynamic()
Check whether the set is dynamic.boolean
isEmpty()
Check whether the set is empty.boolean
isFixed()
Check whether the set is fixed.boolean
isInitialised()
Check whether the set has been initialised.boolean
isRange()
Check whether the set is a range set.java.lang.String
toString()
Generate a string representation of the content of the set.
-
-
-
Method Detail
-
asSet
public final XPRMSet asSet()
Description copied from class:XPRMValue
A set. This function is defined if the actual object is a set.
-
isInitialised
public final boolean isInitialised()
Check whether the set has been initialised. Objects are initialised during model execution. Trying to access a Mosel object that has not been created will result on an exception.- Returns:
-
true
if the set has been created
-
isRange
public final boolean isRange()
Check whether the set is a range set.- Returns:
-
true
ifthe set is a range set
-
isDynamic
public final boolean isDynamic()
Check whether the set is dynamic.- Returns:
-
true
if the set is dynamic
-
isFixed
public final boolean isFixed()
Check whether the set is fixed. A dynamic set is "fixed" when it is used to index an array: it may be extended by receiving new elements but it cannot be re-assigned or reduced.- Returns:
-
true
if the set is fixed
-
getSize
public final int getSize()
Get set size.- Returns:
- Number of elements in the set
-
isEmpty
public final boolean isEmpty()
Check whether the set is empty.- Returns:
-
true
if the set contains no element
-
getFirstIndex
public final int getFirstIndex()
Get the index of the first element in the set. From the library, set elements are accessed using an index.- Returns:
- Index of the first element
-
getLastIndex
public final int getLastIndex()
Get the index of the last element in the set. From the library, set elements are accessed using an index.- Returns:
- Index of the last element
-
getIndex
public abstract int getIndex(XPRMValue v)
Get the index of the given element.- Parameters:
-
v
- element to search - Returns:
- Index of the given element or a negative value if the set does not contain this element
-
getIndex
public int getIndex(int i)
Get the index of the given element (set of integers).- Parameters:
-
i
- element to search - Returns:
- Index of the given element or a negative value if the set does not contain this element
-
getIndex
public int getIndex(double r)
Get the index of the given element (set of reals).- Parameters:
-
r
- element to search - Returns:
- Index of the given element or a negative value if the set does not contain this element
-
getIndex
public int getIndex(boolean b)
Get the index of the given element (set of Booleans).- Parameters:
-
b
- element to search - Returns:
- Index of the given element or a negative value if the set does not contain this element
-
getIndex
public int getIndex(java.lang.String s)
Get the index of the given element (set of strings).- Parameters:
-
s
- element to search - Returns:
- Index of the given element or a negative value if the set does not contain this element
-
get
public final XPRMValue get(int index)
Get the element associated to the given index.- Parameters:
-
index
- index of the element to retrieve - Returns:
- Element associated to the given index
- Throws:
-
java.util.NoSuchElementException
- If the index corresponds to no element in the set.
-
getAsInteger
public int getAsInteger(int index)
Get the element associated to the given index (set of integers).- Parameters:
-
index
- index of the element to retrieve - Returns:
- Element associated to the given index
- Throws:
-
java.util.NoSuchElementException
- If the index corresponds to no element in the set.
-
getAsReal
public double getAsReal(int index)
Get the element associated to the given index (set of reals).- Parameters:
-
index
- index of the element to retrieve - Returns:
- Element associated to the given index
- Throws:
-
java.util.NoSuchElementException
- If the index corresponds to no element in the set.
-
getAsBoolean
public boolean getAsBoolean(int index)
Get the element associated to the given index (set of Booleans).- Parameters:
-
index
- index of the element to retrieve - Returns:
- Element associated to the given index
- Throws:
-
java.util.NoSuchElementException
- If the index corresponds to no element in the set.
-
getAsString
public java.lang.String getAsString(int index)
Get the element associated to the given index (set of strings).- Parameters:
-
index
- index of the element to retrieve - Returns:
- Element associated to the given index
- Throws:
-
java.util.NoSuchElementException
- If the index corresponds to no element in the set.
-
getTypeCode
public final int getTypeCode()
Description copied from interface:XPRMTyped
Type code. The code is one of theTYP_*
values.- Returns:
- Encoded type
-
getTypeName
public final java.lang.String getTypeName()
Description copied from interface:XPRMTyped
String representation of type.- Returns:
- Type name
-
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
-
toString
public final java.lang.String toString()
Generate a string representation of the content of the set.- Overrides:
-
toString
in classjava.lang.Object
- Returns:
- String describing the set content
-
-
© 2001-2019 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.