in my latest assignment, below i have been asked to include javadoc commentry as i go along. As im not familiar with this as yet i had a go but i dont think it is of v.high standard. any ideas on how to improve are much appreciated.
My coding:
/**
*This class represents a series of named items held in a
* {@link MostRecent "most recent" list}.
*All items must have a name, this is a
String, however if two items
*have the same name they are considered equal
*
*/
public class MostRecent
{
// --------------- FIELDS --------------
/** Constant value of 10 for maximum number of items stored in list*/
private static final int MAX_ITEMS = 10;
/** Integer for items in list*/
private int i;
// ------------- CONSTRUCTOR -------------
/** The constructor is an instance method with the same name as the class
*Procedure used to create and inialise MostRecent list
*/
public MostRecent(){
}
// -------------- METHODS ----------------
/**Update the list
*This method updates the list with the most recently accessed item.
*First it will check to see how many items are already in the list
*Next it will move to the top of the list and then get the name of the item
*Finally it enters the name at the top of the list
*/
/* Update List*/
NamedItem recent = new NamedItem
public void update(NamedItem n){
int [] entry = new int[10];
entry[0] = n.getName();
}
/** Display the list
*This method is to print out the name of the most recently accessed item
*It works on the basis that when i = 0 and i is also less than the maximum
*number of items this will add another item onto the list.
*This latest addition to the list is then presented as standard output.
/* Display List*/
public void display()
{System.out.println("---------------------------");
for (i = 0;
i < MAX_ITEMS;
i++);
{
// print name of ith item to standard output
}
}
;
}