• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Commenting code

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone tell me if there is a standard for commmenting code (to produce javadocs and in general)

Some examples would be good if there is a standard for this

or some commenting of this code would be helpful

/**
*
* @author Wade B
*
*/
public class roundRobinScheduler
{

/**
*
*
* @param args
*/
public static void main(String[] args)
{

process p1 = new process( "First Process", 10 );
process p2 = new process( "Second Process", 14);
process p3 = new process( "Third Process", 30);
process p4 = new process( "Fourth Process", 7 );

process[] allJobs = { p1, p2, p3, p4 };

boolean allProcessesComplete = false;



int currentJobIndex = 0;

while( !allProcessesComplete )
{
if( !allJobs[currentJobIndex].complete())
{
allJobs[currentJobIndex].processTimeslice(1);
try
{
java.lang.Thread.sleep(500);
}
catch( Exception e)
{

}
}


currentJobIndex++;


if( currentJobIndex >= allJobs.length)
{
currentJobIndex = 0;
}

if( p1.complete() && p2.complete() && p3.complete() && p4.complete())
{
allProcessesComplete = true;
}


}

}

}
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.
You might find this useful http://java.sun.com/docs/codeconv/
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to write affective comments in java class file?
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You will find your code easier to read if you use the "Code" button.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic