Hello I am trying to take a multi-deminsional array[ ] [ ] (2D (if you will)) and set a varriable through a classes public setter.
//some of the fields
private int request_id;
private String time_stamp;
private int session_id;
private int client_intf;
private int server_intf;
// many more...
// Some Getters
public int getRequest_id() { return request_id; }
public String getTime_stamp()
{
return time_stamp;
}
public int getSession_id()
{
return session_id;
}
public int getClient_intf()
{
return client_intf;
}
public int getServer_intf()
{
return server_intf;
}
// some setters
public void setRequest_id(int request_id)
{
this.request_id = request_id;
}
public void setTime_stamp(String time_stamp)
{
this.time_stamp = time_stamp;
}
public void setSession_id(int session_id)
{
this.session_id = session_id;
}
public void setClient_intf(int client_intf)
{
this.client_intf = client_intf;
}
public void setServer_intf(int server_intf)
{
this.server_intf = server_intf;
}
// initialize variables from array[][]
//todo // FIXME: 2/6/2016
public void initializeUpload(String[][] csvArray)
{
for (int i = 1; i < csvArray.length; i++)
{
for (int j = 0; j < csvArray[i].length; j++)
{
setRequest_id(Integer.parseInt(csvArray[i][j]));
setTime_stamp(csvArray[i][j]);
setSession_id(Integer.parseInt(csvArray[i][j]));
// I know this is setting them over and I just
// know how to approach this problem
//any insight would be very much apprecitated.
// this is just part of a larger app
}
}
}