View Single Post
Old Dec 20th, 2006, 12:36 AM   #3
JavaBeginner
Newbie
 
Join Date: Sep 2005
Posts: 7
Rep Power: 0 JavaBeginner is on a distinguished road
Thanks for your help. Here is a quick description of the above:

public class NewList<ItemType> implements SmallList<ItemType>
{
             public NewList()
             {
                       //Constructs a new empty list and sets m & p to 0.
                       //m is the length of the list and p marks the current position.
                       //One constructor and no parameters.
              }

	public boolean insertItem(ItemType newItem)
	{
		//If p or m = the max length in SmallList, it fails
                          //If success, every item i is moved to the right
                          //Length of list m is increased by 1
                          //Value of p has not changed
                          //Current item is newItem.
	}
	public boolean delItem()
	{
		//If m or p = 0, it fails
                          //If success, the item in p is deleted
                          //Every item i is shifted to the left by one position
                          //Length of list m is decreased by 1
                          //Current position p has not changed.
	}
	public boolean newPos()
	{
		//Is true if 1 is less than or equal to p and p is less
                          //than or equal to m and returns false otherwise
	}
	public ItemType getItem();
	{
		//If 1 is less than or equal to p and p is less than or equal
                          //to m, it returns the item in p.  Otherwise it is null.
	}
}
JavaBeginner is offline   Reply With Quote