public Double getHighBidAmount() { ArrayList<Bid> bidResults = new ArrayList<Bid>(); Double result = 0.00; ElasticSearchCtr.GetBid getBid = new ElasticSearchCtr.GetBid(); getBid.execute(new String[] {"bidStallID", this.getStallID()}); try { bidResults = getBid.get(); } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } for (Bid b : bidResults) { result = Math.max(result, b.BidAmount()); } return result; }
public void setStatus() { if (Borrower != "") { Status = "Borrowed"; } ElasticSearchCtr.GetBid getBid = new ElasticSearchCtr.GetBid(); String[] query = new String[2]; query[0] = "bidStallID"; query[1] = this.getStallID(); getBid.execute(query); try { ArrayList<Bid> all = getBid.get(); if (all.size() > 0) { Status = "Bidded"; } else { Status = "Available"; } } catch (InterruptedException | ExecutionException e) { e.printStackTrace(); } }