Note that there are some explanatory texts on larger screens.

plurals
  1. POput data to constructor in another class
    primarykey
    data
    text
    <p>i got a class call ClientIdBandwidth.java as shown at below</p> <pre><code>public class ClientIdBandwidth { private int clientID; private int bandwidth; public ClientIdBandwidth(int clientID , int bandwidth) { this.clientID = clientID; this.bandwidth = bandwidth; } public int getClientID() { return clientID; } public int getBandwidth() { return bandwidth; } } </code></pre> <p>i want to call the ClientIdBandwidth constructor and and put the data to the constructor? below is the code that i have do so far : </p> <pre><code>public class connectNode { private List[] connection; private int totalClients; totalClients = clientList.size(); //get the size from another class connection = new Vector[totalClients]; // for(int i = 0; i&lt;totalClients; i++) { connection[i] = new Vector(); } for(int i = 0; i&lt;totalClients; i++) { int ID = (int)clientList.get(i); ClientIdBandwidth cib = new ClientIdBandwidth(ID,'0'); } </code></pre> <p>after that, i have no idea how to continued on . can anyone teach me ? thanks in advance </p> <p><strong>UPDATE</strong></p> <p>sorry that i didnt make it clear.</p> <p>i am now doing a p2p simulator. i have a text file : </p> <p>0;2;100; // Node 0 connect to Node 2 with 100kbps</p> <p>1;5;200; // Node 1 connect to Node 5 with 200kbps</p> <p>i have class that will read the txt file. and it have put the total how many node(in example above is 4 which is Node 0,2,1,5) inside a list. now i want to set like node 0 is connect to node 2 with bandwidth to a vector. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload