Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Swig only in maintainer mode
[simgrid.git] / src / bindings / java / org / simgrid / surf / Action.java
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.11
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8
9 package org.simgrid.surf;
10
11 public class Action {
12   private long swigCPtr;
13   protected boolean swigCMemOwn;
14
15   protected Action(long cPtr, boolean cMemoryOwn) {
16     swigCMemOwn = cMemoryOwn;
17     swigCPtr = cPtr;
18   }
19
20   protected static long getCPtr(Action obj) {
21     return (obj == null) ? 0 : obj.swigCPtr;
22   }
23
24   protected void finalize() {
25     delete();
26   }
27
28   public synchronized void delete() {
29     if (swigCPtr != 0) {
30       if (swigCMemOwn) {
31         swigCMemOwn = false;
32         SurfJNI.delete_Action(swigCPtr);
33       }
34       swigCPtr = 0;
35     }
36   }
37
38   protected static long[] cArrayUnwrap(Action[] arrayWrapper) {
39       long[] cArray = new long[arrayWrapper.length];
40       for (int i=0; i<arrayWrapper.length; i++)
41         cArray[i] = Action.getCPtr(arrayWrapper[i]);
42       return cArray;
43   }
44
45   protected static Action[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
46     Action[] arrayWrapper = new Action[cArray.length];
47     for (int i=0; i<cArray.length; i++)
48       arrayWrapper[i] = new Action(cArray[i], cMemoryOwn);
49     return arrayWrapper;
50   }
51
52   public Action(Model model, double cost, boolean failed) {
53     this(SurfJNI.new_Action(Model.getCPtr(model), model, cost, failed), true);
54   }
55
56   public Model getModel() {
57     long cPtr = SurfJNI.Action_getModel(swigCPtr, this);
58     return (cPtr == 0) ? null : new Model(cPtr, false);
59   }
60
61   public LmmVariable getVariable() {
62     long cPtr = SurfJNI.Action_getVariable(swigCPtr, this);
63     return (cPtr == 0) ? null : new LmmVariable(cPtr, false);
64   }
65
66   public ActionState getState() {
67     return ActionState.swigToEnum(SurfJNI.Action_getState(swigCPtr, this));
68   }
69
70   public boolean isSuspended() {
71     return SurfJNI.Action_isSuspended(swigCPtr, this);
72   }
73
74   public double getBound() {
75     return SurfJNI.Action_getBound(swigCPtr, this);
76   }
77
78   public void setBound(double bound) {
79     SurfJNI.Action_setBound(swigCPtr, this, bound);
80   }
81
82   public void updateRemains(double delta) {
83     SurfJNI.Action_updateRemains(swigCPtr, this, delta);
84   }
85
86   public double getRemains() {
87     return SurfJNI.Action_getRemains(swigCPtr, this);
88   }
89
90   public void setPriority(double priority) {
91     SurfJNI.Action_setPriority(swigCPtr, this, priority);
92   }
93
94   public void setState(ActionState state) {
95     SurfJNI.Action_setState(swigCPtr, this, state.swigValue());
96   }
97
98 }