public T getRandomObject(Random rand)
	{
		if(!list.isEmpty())
		{
			int r = rand.nextInt(totalWeight);
			Iterator<WeightEntry> i = list.iterator();
			while(i.hasNext())
			{
				WeightEntry e = i.next();
				if(e.inRange(r))
				{
					return e.getObject();
				}
			}
		}
		return null;
	}