I need to fetch information from 2D array and if they are match put in temp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saqib15
    New Member
    • Feb 2010
    • 1

    I need to fetch information from 2D array and if they are match put in temp

    private WSUser[][] getUsersInRole (WSRole[] roles, WSUser[] input_users) {
    boolean found = true;

    /// Initialize output_users: 2-dimensional array of WSUser; first dimension is same length as WSRole.
    WSRole[] role = null;
    WSUser[][] output_users = null;
    Array[][] temparray=null;
    //temparray = new int[roles][input_users];
    // WSUser[][] temp=null;
    /// Iterate through roles (using int i) and get array of WSUser for each
    for(int r =0; r<roles.length ; r++){
    WSUser[] users = roles[r].getUsers();
    for(int i=0; i<users.length ; i++){
    // Compare roles[i].users to input_users, add matches to tempusersarray
    if(roles[r].getUsers().equ als(users[i].getName())){
    if(found=true){
    // temp =users[r][i];
    }
    }
    }
    }
    // Set output_users [i] = tempusersarray
    //output_users =temp;
    return output_users;
    }
Working...