public void printUnsold()
{
ArrayList<Lot> unsoldLots = getUnsold(); // Initialise arraylist// Make temporary arraylist for unsolt lots of type Lot
for(Lot tmp : unsoldLots) {
System.out.println(tmp.toString());
}
}
/**
* Show only unsold
*/
public ArrayList<Lot> getUnsold()
{
ArrayList<Lot> unsoldLots = new ArrayList<Lot>(); // Initialise arraylist// Make temporary arraylist for unsolt lots of type Lot
Iterator<Lot> it = lots.iterator(); // Iterate through lots abd refer to each temporary iteration as "it"
while(it.hasNext()) {
Lot tmpLot = it.next();
if (tmpLot.getHighestBid() == null) {
unsoldLots.add(tmpLot);
}
}
return unsoldLots;
}