Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Ok, I have a Json Array:

JsonArray gridItemArray = myColumns.getAsJsonArray();

(at this point, myColumns & gridItemArray (as I believe it should be, but could be wrong) =

 [
    [
        14,
        "1",
        "bridge_routine_link",
        "Y",
        "Y",
        "100",
        "CENTER",
        "Cheese",
        "",
        "",
        "",
        "LEFT",
        "LEFT",
        "LEFT",
        "LEFT",
        "",
        "0",
        "",
        "string",
        "",
        ""
    ]
]

)

Now, I create a multidimensional array:

columnData = new String[gridItemArray.size()][21];

Now. I need to get each individual element out of gridItemArray and put it into columnData so that for each item in gridItemArray, I get the following for columnData:

First element in columnData[0][0]:

["some_item_name_that_matches_DB_Field"][14]

Second element in columnData[1][1]:

["next_DB_field_name"]["1]

Until all 21 items have been assigned a string literal for the first array and a value for the second array.

Please advise.

share|improve this question
 
What have you tried so far? –  Adam Arold Feb 27 at 15:36
 
Several things, the latest being this (which of course didn't work): for (int i = 0; i < gridItemArray.size(); i++){ // columnData[][] = { // {"item_index", gridItemArray.get(i).getAsString()}, // {"column_index", gridItemArray.get(i).getAsString()}, // {"data_index", gridItemArray.get(i).getAsString()}..etc –  Jon Smith Feb 27 at 15:39
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.