Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
merge msg_vm.c - adrien (please note that there is one line (destruction of the tx_pr...
[simgrid.git] / src / bindings / java / org / simgrid / surf / NetworkLink.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 /**
12  * A generic resource for the network component
13  */
14 public class NetworkLink extends Resource {
15   private long swigCPtr;
16
17   protected NetworkLink(long cPtr, boolean cMemoryOwn) {
18     super(SurfJNI.NetworkLink_SWIGUpcast(cPtr), cMemoryOwn);
19     swigCPtr = cPtr;
20   }
21
22   protected static long getCPtr(NetworkLink obj) {
23     return (obj == null) ? 0 : obj.swigCPtr;
24   }
25
26   protected void finalize() {
27     delete();
28   }
29
30   public synchronized void delete() {
31     if (swigCPtr != 0) {
32       if (swigCMemOwn) {
33         swigCMemOwn = false;
34         SurfJNI.delete_NetworkLink(swigCPtr);
35       }
36       swigCPtr = 0;
37     }
38     super.delete();
39   }
40
41   protected static long[] cArrayUnwrap(NetworkLink[] arrayWrapper) {
42       long[] cArray = new long[arrayWrapper.length];
43       for (int i=0; i<arrayWrapper.length; i++)
44         cArray[i] = NetworkLink.getCPtr(arrayWrapper[i]);
45       return cArray;
46   }
47
48   protected static NetworkLink[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
49     NetworkLink[] arrayWrapper = new NetworkLink[cArray.length];
50     for (int i=0; i<cArray.length; i++)
51       arrayWrapper[i] = new NetworkLink(cArray[i], cMemoryOwn);
52     return arrayWrapper;
53   }
54
55   
56   /**
57     * @return The bandwidth of the link
58     */
59   public double getBandwidth() {
60     return SurfJNI.NetworkLink_getBandwidth(swigCPtr, this);
61   }
62
63   
64   /**
65     * @param value The new bandwidth
66     */
67   public void updateBandwidth(double value, double date) {
68     SurfJNI.NetworkLink_updateBandwidth__SWIG_0(swigCPtr, this, value, date);
69   }
70
71   
72   /**
73     * @param value The new bandwidth
74     */
75   public void updateBandwidth(double value) {
76     SurfJNI.NetworkLink_updateBandwidth__SWIG_1(swigCPtr, this, value);
77   }
78
79   
80   /**
81     * @return The latency of the link
82     */
83   public double getLatency() {
84     return SurfJNI.NetworkLink_getLatency(swigCPtr, this);
85   }
86
87   
88   /**
89     * @param value The new latency
90     */
91   public void updateLatency(double value, double date) {
92     SurfJNI.NetworkLink_updateLatency__SWIG_0(swigCPtr, this, value, date);
93   }
94
95   
96   /**
97     * @param value The new latency
98     */
99   public void updateLatency(double value) {
100     SurfJNI.NetworkLink_updateLatency__SWIG_1(swigCPtr, this, value);
101   }
102
103 }