This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Collection" Watch "Collection" New topic
Author

Collection

ronald dsouza
Greenhorn

Joined: Jun 16, 2011
Posts: 4
I am calling a webservice which returns me a collection which contains a string like below:
Model1|mdesc|Table1|tdesc|Col1|cdesc
Model1|mdesc|Table2|tdesc|Col1|cdesc
Model1|mdesc|Table1|tdesc|Col2|cdesc
Model1|mdesc|Table2|tdesc|Col2|cdesc
.
.
.


I have to create a list showing how many table's the model has and its columns.
What is the best collection to use here? I might later have to iterate this collection and create a html page so it should be easier to access.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38025
    
  22
Not sure from your brief description. Have you gone through the different types of collection, which you can find about here?

You might want a List of Lists, but that is not at all certain from your post.
ronald dsouza
Greenhorn

Joined: Jun 16, 2011
Posts: 4
Campbell Ritchie wrote:Not sure from your brief description. Have you gone through the different types of collection, which you can find about here?

You might want a List of Lists, but that is not at all certain from your post.

Input:
Model1|mdesc|Table1|tdesc1|Col1|cdesc1
Model1|mdesc|Table2|tdesc2|Col1|cdesc2
Model1|mdesc|Table1|tdesc1|Col2|cdesc3
Model1|mdesc|Table2|tdesc2|Col2|cdesc4
.
.
.

The output I except is:
model1
mdesc
Table1
tdesc1
col1
cdesc1
col2
cdesc3
table2
tdesc2
col1
cdesc2
col2
cdesc4

can this be done?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38025
    
  22
If you can explain how you get from the four lines above to the column below, then you can do it programmatically.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Collection
 
Similar Threads
Question of using SqlResultSetMapping
Improving performance of view
Toad Modeler PFK issue
Projection from inner join
data migration from one table to the other