Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

output in a table format

Thread view: 
Jonie - 12 Jan 2006 12:52 GMT
hi all,
i have about 30 variables in my java program that i have to keep track
of over every tick count.  i have been just using "print" function for
all the variables. as you expect, it is not very convienient.
so i am wondering if there are methods that shows variables in a table
format which is updated at every tick count but still preserves the
data for the previous tick count.

         tick1 tick2 tick3 ...
  var1  a        b       c  ...
  var2  a'       b'       c'  ...
  var3  a''       b''      c'' ...
   ..

finally, i want the data to be saved in a file so that i can import it
in microsoft excel.  

i would like your help.  Thanks.
rsaccone@gmail.com - 13 Jan 2006 14:34 GMT
As a first shot I might try the following:

var1, var2, var3 etc.. become Objects we'll call them Ticker.  You
didn't indicate the purpose of these variables so I will leave it to
you to name the Objects something relevant.  Depending on your access
needs you can store all needed instances of these new Tickers in a List
or Map that lives in your TickTracker class.

Each Ticker has a List<String> tickVal where you will store the value
for each tick.  Obviously if your ticks don't correlate with index
values you can use a Map.

Finally I would introduce a TickWriter class with method
writeTicks(List<Ticker> theTickers) that handles the writing of the
Tickers.  In the TickWriter you can format the output however you like.

Later on you can pull the Format functionality out of the TickWriter
into a TickOutputFormatter interface you can set at run time then pass
into your TickWriter.  That allows you to play with different output
formats without effecting the other code.  

Hope this helps
Rich
Jonie - 13 Jan 2006 15:38 GMT
Thank you, Rich. I will try as you suggested.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.