// Test method public LinkedList<Integer> getLiveAuctionsIds() throws RemoteException { LinkedList<Integer> ll = new LinkedList<Integer>(); for (AuctionItem t : liveAuctionItems.values()) { ll.add(t.getAuctionId()); } return ll; }
@Override public LinkedList<String> getExistingAuctions() throws RemoteException { LinkedList<String> ll = new LinkedList<String>(); for (AuctionItem i : liveAuctionItems.values()) { ll.add(i.toString()); } return ll; }
@Override public LinkedList<String> getExpiredAuctions() throws RemoteException { LinkedList<String> ll = new LinkedList<String>(); for (ExpiredAuctionItem item : expiredAuctions.values()) { ll.add(item.toString()); } return ll; }
/** * Helper function: update the "old" RM group with the "next" group provided. * * @param old * @param next */ private void updateRMGroup(LinkedList<MemberInfo> old, LinkedList<MemberInfo> next) { if (next == null || next.isEmpty()) { System.out.println("empty or null next MemberInfo sent in updated."); return; } // Add to our old list the memberInfo objects that were not previously there. for (MemberInfo m : next) { if (old == null) { System.out.println("OLD NULL"); } if (m == null) { System.out.println("M NULL"); } if (!old.contains(m)) { old.add(m); } } // Remove from our old list the memberInfo objects that are absent in next. LinkedList<MemberInfo> toRemove = new LinkedList<MemberInfo>(); for (MemberInfo m : old) { if (!next.contains(m)) { toRemove.add(m); } } for (MemberInfo m : toRemove) { old.remove(m); } }