4 Replies - 506 Views - Last Post: 31 January 2016 - 07:59 AM Rate Topic: -----

#1 zerocool18   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 186
  • Joined: 12-October 12

extracting data from an array list and saving it into 2 datas

Posted 31 January 2016 - 07:18 AM

hello im trying to get the data i have saved into my arraylist. i want to take the id and questions i have saved in there and save them separately. Is this possible? for exemple my array list is this

List<Observation> entries = new ArrayList<>();


in it i save an Int and a boolean array . so it looks like {1 , true} . is it possible to extract each data and save them separetly? id like to save the Int part in its own int. and the boolean in a array.

This post has been edited by zerocool18: 31 January 2016 - 07:19 AM


Is This A Good Question/Topic? 0
  • +

Replies To: extracting data from an array list and saving it into 2 datas

#2 NormR   User is online

  • D.I.C Lover
  • member icon

Reputation: 870
  • View blog
  • Posts: 6,695
  • Joined: 25-December 13

Re: extracting data from an array list and saving it into 2 datas

Posted 31 January 2016 - 07:44 AM

Quote

is it possible to extract each data and save them separetly?

Why? Having the related data items in one place can be more efficient and less confusing to work with.
Was This Post Helpful? 0
  • +
  • -

#3 zerocool18   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 186
  • Joined: 12-October 12

Re: extracting data from an array list and saving it into 2 datas

Posted 31 January 2016 - 07:47 AM

im trying to split the data up and save them separate because i need to send this data to an api that accepts an int and a arraylist. which is an ID and answers (array of booleans). so i need to split the entries array list i made and take out the id and boolean array and save them seperatley so i can send em.
Was This Post Helpful? 0
  • +
  • -

#4 NormR   User is online

  • D.I.C Lover
  • member icon

Reputation: 870
  • View blog
  • Posts: 6,695
  • Joined: 25-December 13

Re: extracting data from an array list and saving it into 2 datas

Posted 31 January 2016 - 07:58 AM

Why not send the full arraylist with all the data and let the called method extract what it needs?
Rather than extracting the data and sending it separately.

Or why create the arraylist if what you need is separated data?

This post has been edited by NormR: 31 January 2016 - 07:58 AM

Was This Post Helpful? 0
  • +
  • -

#5 zerocool18   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 186
  • Joined: 12-October 12

Re: extracting data from an array list and saving it into 2 datas

Posted 31 January 2016 - 07:59 AM

View PostNormR, on 31 January 2016 - 07:58 AM, said:

Why not send the full arraylist with all the data and let the called method extract what it needs?
Rather than extracting the data and sending it separately.


i didnt know that was possible lol , ill try that thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1