File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 39393
    
  28
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: 39393
    
  28
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