コード例 #1
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();
  }
コード例 #2
0
 public String toString() {
   StringBuffer result = new StringBuffer();
   result.append("\nMighty Gumball, Inc.");
   result.append("\nJava-enabled Standing Gumball Model #2014");
   result.append("\nInventory: " + count + " gumball");
   if (count != 1) {
     result.append("s");
   }
   result.append("\n");
   result.append("Machine is " + state + "\n");
   return result.toString();
 }