Code example for ConcurrentHashMap

Methods: containsKeygetputIfAbsent

0
	 
	/** 
	 * NOT TO BE CALLED BY AuctionHouse 
	 */ 
	public void put(Auction auction, Bid bid) {
		if (!this.map.containsKey(auction)) {
			List<Bid> newAuctionBids = Collections.synchronizedList(new ArrayList<Bid>());
			map.putIfAbsent(auction, newAuctionBids);
		} 
		this.map.get(auction).add(bid);
	} 
	 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE