Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
730a281cfec372a5129013abdbc977ba910953e5
[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.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 NetworkLink extends Resource {
12   private long swigCPtr;
13
14   protected NetworkLink(long cPtr, boolean cMemoryOwn) {
15     super(SurfJNI.NetworkLink_SWIGUpcast(cPtr), cMemoryOwn);
16     swigCPtr = cPtr;
17   }
18
19   protected static long getCPtr(NetworkLink obj) {
20     return (obj == null) ? 0 : obj.swigCPtr;
21   }
22
23   protected void finalize() {
24     delete();
25   }
26
27   public synchronized void delete() {
28     if (swigCPtr != 0) {
29       if (swigCMemOwn) {
30         swigCMemOwn = false;
31         SurfJNI.delete_NetworkLink(swigCPtr);
32       }
33       swigCPtr = 0;
34     }
35     super.delete();
36   }
37
38   protected static long[] cArrayUnwrap(NetworkLink[] arrayWrapper) {
39       long[] cArray = new long[arrayWrapper.length];
40       for (int i=0; i<arrayWrapper.length; i++)
41         cArray[i] = NetworkLink.getCPtr(arrayWrapper[i]);
42       return cArray;
43   }
44
45   protected static NetworkLink[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
46     NetworkLink[] arrayWrapper = new NetworkLink[cArray.length];
47     for (int i=0; i<cArray.length; i++)
48       arrayWrapper[i] = new NetworkLink(cArray[i], cMemoryOwn);
49     return arrayWrapper;
50   }
51
52   public double getBandwidth() {
53     return SurfJNI.NetworkLink_getBandwidth(swigCPtr, this);
54   }
55
56   public void updateBandwidth(double value, double date) {
57     SurfJNI.NetworkLink_updateBandwidth__SWIG_0(swigCPtr, this, value, date);
58   }
59
60   public void updateBandwidth(double value) {
61     SurfJNI.NetworkLink_updateBandwidth__SWIG_1(swigCPtr, this, value);
62   }
63
64   public double getLatency() {
65     return SurfJNI.NetworkLink_getLatency(swigCPtr, this);
66   }
67
68   public void updateLatency(double value, double date) {
69     SurfJNI.NetworkLink_updateLatency__SWIG_0(swigCPtr, this, value, date);
70   }
71
72   public void updateLatency(double value) {
73     SurfJNI.NetworkLink_updateLatency__SWIG_1(swigCPtr, this, value);
74   }
75
76 }