Пример #1
0
 @Override
 public LinkedList<String> getExpiredAuctions() throws RemoteException {
   LinkedList<String> ll = new LinkedList<String>();
   for (ExpiredAuctionItem item : expiredAuctions.values()) {
     ll.add(item.toString());
   }
   return ll;
 }
Пример #2
0
 @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;
 }
Пример #3
0
  @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();
  }