キュー タイプのラッパーを作成していますが、要素を追加するたびに、内部のすべてを並べ替えたいと考えています。ほとんどの場合、 Integerになります。コレクションフレームワークにあまり詳しくありません。簡単な解決策はありますか?
public class Round<Type> {
private Queue<Type> qe;
public Round(){
this.qe = new LinkedList<Type>();
}
public void push(Type p){
this.qe.offer(p);
//Collections.sort(this.qe); Here I want to sort this
}
public Type pop(){
return this.qe.poll();
}
}