My List class is terribly piecey and long - so I'm going to cut & paste what I believe the root of this particular problem is....
Here is the method I am trying to write:
private Item item; //creates new Item: status, name, price
private List A = new List(); //creates a new List (which is an inner class)
public class List
{
public List() //makes empty list - all I have so far
{
head = null;
}
}
public String[] whatWeHave(int user)
{
//on hand counts the number of items in the list
String[] weHave = new String[onHand()];
int size = 0;
Node current = head;
Node previous = null;
while(size < weHave.length)
{
if(user == 0) //user input - 0 = everything we have in stock
{
//am also unsure how to sort status - use a for loop?
//thought about putting this in somewhere:
//current.item.getStatus().equals("i"); and if true add to the list -
//I guess that's a different method?
// status is either: i = in stock, o = need to order
A.toArray(weHave);
}
}
return weHave;
}
ANY ideas, hints, links, references - will be greatly appreciated!!!
Thank you in advance for reading this!
This post has been edited by kiboko: 27 November 2008 - 12:25 PM

New Topic/Question
Reply




MultiQuote




|