@Override public LinkedList<String> getExpiredAuctions() throws RemoteException { LinkedList<String> ll = new LinkedList<String>(); for (ExpiredAuctionItem item : expiredAuctions.values()) { ll.add(item.toString()); } return ll; }
@Override public boolean removeAuction(int auctionId) { if (!expiredAuctions.containsKey(auctionId)) { System.out.println("This auction has not expired \n"); return false; } ExpiredAuctionItem temp; if ((temp = expiredAuctions.remove(auctionId)) != null) { System.out.println("Auction: " + temp.toString() + " has been completely removed\n"); return true; } return false; }
@Override public String lookForExpiredAuction(int auctionId) throws RemoteException { ExpiredAuctionItem temp; StringBuffer sb = new StringBuffer(); if ((temp = expiredAuctions.get(auctionId)) != null) { System.out.println("Expired auction found, results of this auction :" + temp.getResult()); sb.append("Results of this auction :\n" + temp.getResult() + "\n"); sb.append("General info of this auction : \n" + temp.toString() + "\n"); } return sb.toString(); }