A queue is a queue - get(int) works on a list. If you want to get the nth item based on a 'cost' you'll have to use Collections.sort on a list (or Arrays.sort on an array) and pass it a Comparator...