Java: showing the output of a separate for loop as an extra column shown in a console -


Bit of reference ...

In my project I have been embedded for a loop, The data gets output, shows items for each category, and shows its assets within each item, so in fact, the 3 columns of data in the output console generated (headings: category / item / property), to show this data, loop Looks like this (variables are in the law First set):

For ... (for each category it chooses) ... (string property name: selects item for item) Name: item.getPropertyNames ()) {Out.println (category.getName () + "\ t" + itemDesc.getName () + "\ t Property:" + propertyName); }}}

The purpose of this system is to provide more dynamic documentation of the properties of components set in the system. (It makes it possible to separate them in different columns on the / T console and even in an Excel spreadsheet in the file, I have to set the file to printstream (along with the beginning of this method). )

Problem

For the problem now, after the above loops, I have created another for the loop separately from the data but shows a list of all the functions and operators included in the components Is:

// For loops out of the previous (function function: functions. All functions) {Outkprintln (FunctionkgetSignature ()); }

I have to set this list as a 4th column, but the position of the loop and the way it is set is fixed on the first column with the categories . I can not add it after the name of the property because it is more common for all things in the work list and there is a method of repetition of the tasks which I am trying to avoid to set it as a forward column? There is a problem finding sufficient research that explains what I'm seeing here. Hope this makes sense.

A solution, if the total amount of output is small enough to fit in memory, all data Have to save in any ArrayList to string , and it is to output to everyone at the very end.

  list & lt; String & gt; MyList = new Arsèchchi & lt; String & gt; (); For ... (for each class chooses) ... (String property name: item.getPropertyNames ()) (myList.add (category.getName) + "\ t" + itemDesc GetName () + "\ Property: "+ propertyName); }}} Int i = 0; // Here we believe that the output of the total lines of the previous set of loops // is equal to the total output by this loop. For (function function: functions. Alfations) {out.println (myList.get (i) + "\ t" + function .getSignature ()); I ++; }  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -