Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename NetworkLink type to Link
[simgrid.git] / src / bindings / java / org / simgrid / surf / Link.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 Link extends Resource {
15   private long swigCPtr;
16
17   protected Link(long cPtr, boolean cMemoryOwn) {
18     super(SurfJNI.Link_SWIGUpcast(cPtr), cMemoryOwn);
19     swigCPtr = cPtr;
20   }
21
22   protected static long getCPtr(Link 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_Link(swigCPtr);
35       }
36       swigCPtr = 0;
37     }
38     super.delete();
39   }
40
41   protected static long[] cArrayUnwrap(Link[] arrayWrapper) {
42       long[] cArray = new long[arrayWrapper.length];
43       for (int i=0; i<arrayWrapper.length; i++)
44         cArray[i] = Link.getCPtr(arrayWrapper[i]);
45       return cArray;
46   }
47
48   protected static Link[] cArrayWrap(long[] cArray, boolean cMemoryOwn) {
49     Link[] arrayWrapper = new Link[cArray.length];
50     for (int i=0; i<cArray.length; i++)
51       arrayWrapper[i] = new Link(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.Link_getBandwidth(swigCPtr, this);
61   }
62
63   
64   /**
65     * @param value The new bandwidth
66     */
67   public void updateBandwidth(double value, double date) {
68     SurfJNI.Link_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.Link_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.Link_getLatency(swigCPtr, this);
85   }
86
87   
88   /**
89     * @param value The new latency
90     */
91   public void updateLatency(double value, double date) {
92     SurfJNI.Link_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.Link_updateLatency__SWIG_1(swigCPtr, this, value);
101   }
102
103 }