Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
4a5755f438e9cafdd43aaf4970a58490708d56a0
[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.12
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   public Action(Model model, double cost, boolean failed) {
39     this(SurfJNI.new_Action(Model.getCPtr(model), model, cost, failed), true);
40   }
41
42   public Model getModel() {
43     long cPtr = SurfJNI.Action_getModel(swigCPtr, this);
44     return (cPtr == 0) ? null : new Model(cPtr, false);
45   }
46
47   public LmmVariable getVariable() {
48     long cPtr = SurfJNI.Action_getVariable(swigCPtr, this);
49     return (cPtr == 0) ? null : new LmmVariable(cPtr, false);
50   }
51
52   public ActionState getState() {
53     return ActionState.swigToEnum(SurfJNI.Action_getState(swigCPtr, this));
54   }
55
56   public boolean isSuspended() {
57     return SurfJNI.Action_isSuspended(swigCPtr, this);
58   }
59
60   public double getBound() {
61     return SurfJNI.Action_getBound(swigCPtr, this);
62   }
63
64   public void setBound(double bound) {
65     SurfJNI.Action_setBound(swigCPtr, this, bound);
66   }
67
68   public void updateRemains(double delta) {
69     SurfJNI.Action_updateRemains(swigCPtr, this, delta);
70   }
71
72   public double getRemains() {
73     return SurfJNI.Action_getRemains(swigCPtr, this);
74   }
75
76   public void setPriority(double priority) {
77     SurfJNI.Action_setPriority(swigCPtr, this, priority);
78   }
79
80   public void setState(ActionState state) {
81     SurfJNI.Action_setState(swigCPtr, this, state.swigValue());
82   }
83
84 }