java中PriorityQueue中的比较器用法问题

public class Test {

public static void main(String[] args) {
    Queue<Integer> queues=new PriorityQueue<Integer>(10,
            new Comparator<Integer>(){
                public int compare(Integer i,Integer j){
                    int result=i%2-j%2;
                    if(result==0){
                        result=i-j;
                    }
                    return result;
                }
    });
    for(int i=0;i<10;i++){
        queues.offer(i);
    }
    for(int i=0;i<10;i++){
        System.out.println();
    }
}

}


当我把0~9一个一个插入到这个队列中的时候比较器是怎么进行比较的呢?

public int compare(Integer i,Integer j)

中的i和j代表的是什么呢?

http://www.cnblogs.com/end/archive/2012/10/25/2738493.html