org.gecode.VarArray< Var extends GecodeVar > Class Reference
[Setting up scripts, Integer variables, Set variables]
List of all members.Detailed Description
Array of variables.This class manages a collection of variables and presents them as an array. The class has many different constructors for automatically instantiating the variables. The following list shows the different kinds:
- VarArray(int): The argument is only used as a hint on how many variables will be added later (same as for the constructor with the same signature in ArrayList). No new variables are created.
- VarArray(some variables): Construct an array out of the supplied variables. No new variables are created.
- VarArray(Space, int, Class, ...): Construct some specified number of variables. The different additional arguments allows for supplying the arguments to the constructor. For example, the invocation will construct 81 new variables in hme, where all are initialized to the domain
VarArray(home, 81, IntVar.class, 1, 9)
[1..9]. - VarArray(Space, Class, ...): Construct some number of variables. The additional arguments are of array-type, and their length will determine the number of new varaibles created. Given an array
a,a.lengthnew variables will be created where variableiwill be initialized witha[i]as an argument.
The class is parametrised on the type of variables used.
Definition at line 59 of file VarArray.java.
Public Member Functions | |
| VarArray () | |
| Construct empty array. | |
| VarArray (int size) | |
| Construct empty array with inital capacity. | |
| boolean | assigned () |
| Test wheter all variables in this array are assigned. | |
| void | swap (int a, int b) |
| Swap positions a and b. | |
| String | toString () |
Package Functions | |
| SuppressWarnings ("unchecked") public< C extends Iterable< Var >> VarArray(JavaSpace newHome | |
| Create copies of the elements of va in newHome and add them into this array. | |
| B | VarArray (JavaSpace home, Class<?extends Var > type, A[] as, B[] bs) |
Package Attributes | |
| boolean | share |
Constructor & Destructor Documentation
| org.gecode.VarArray< Var extends GecodeVar >.VarArray | ( | ) |
| org.gecode.VarArray< Var extends GecodeVar >.VarArray | ( | int | size | ) |
| B org.gecode.VarArray< Var extends GecodeVar >.VarArray | ( | JavaSpace | home, | |
| Class<?extends Var > | type, | |||
| A[] | as, | |||
| B[] | bs | |||
| ) | [package] |
Definition at line 217 of file VarArray.java.
Member Function Documentation
| org.gecode.VarArray< Var extends GecodeVar >.SuppressWarnings | ( | "unchecked" | ) | [package] |
Create copies of the elements of va in newHome and add them into this array.
| boolean org.gecode.VarArray< Var extends GecodeVar >.assigned | ( | ) |
| void org.gecode.VarArray< Var extends GecodeVar >.swap | ( | int | a, | |
| int | b | |||
| ) |
| String org.gecode.VarArray< Var extends GecodeVar >.toString | ( | ) |
Definition at line 258 of file VarArray.java.
Member Data Documentation
Definition at line 76 of file VarArray.java.
The documentation for this class was generated from the following file:
- org/gecode/VarArray.java (Revision: 3796)
