aspose file tools
The moose likes Beginning Java and the fly likes displaying a collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "displaying a collection" Watch "displaying a collection" New topic
Author

displaying a collection

Maureen Charlton
Ranch Hand

Joined: Oct 04, 2004
Posts: 218
I have the following code to display a collection:



The above code gives me the following output to screen:

Entry Set is:
[NV52SSD=NV52SSD 1003 Ford Mondeo White, QP43SSX=qp43SSX 100
3 Ford Fiesta Pink, ZZ43SSX=ZZ43SSX 0182 Ford Fiesta
Yellow]
The number of records within the collections is: 3

Is there a way of tidying up the way a collection is displayed?
i.e. can you edit it in some way using the \t for tabs like you would normally?
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
You can iterate the collection manually and append each element to a StringBuffer along with some delimiter in between (tab for example).


James Carman, President<br />Carman Consulting, Inc.
Maureen Charlton
Ranch Hand

Joined: Oct 04, 2004
Posts: 218
James,

You darling! I've spent hours trying to find a way to do this.

Thank you.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Well, I try!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: displaying a collection
 
Similar Threads
Accessing Arrays and Editing Objects Within Them From Other Class'
Which car to buy..?[India]
Creating an Exception
TreeMap
alternative to nested if in TreeMap values