Code example for Queue

Methods: offer

0
			Queue<ItemPair> light_weights, Queue<ItemPair> heavy_weights)
	{ 
		if (value < threshold) 
			light_weights.offer(new ItemPair(key, null, value));
		else 
			heavy_weights.offer(new ItemPair(null, key, value));
	} 
	 
	/** 
	 * Sets the seed used by the internal random number generator. 
	 */ 
	public void setRandomSeed(long seed)
	{ 
		this.random.setSeed(seed);
	} 
	 
	/** 
	 * Retrieves an item with probability proportional to its weight in the 
	 * {@code Map} provided in the input. 
	 */ 
	public T nextItem()