java - Is there a Queue (PriorityQueue) implementation which is also a Set? -


I am looking for an implementation which is also one.

Compare implementation if its elements should not be required to be compliant with the implementation of equal .

Is there such an implementation for Java?

Update: I've implemented it now as an internal archive using a sorted set. So I had to implement missing methods only to complete the queue interface. I also forgot to mention that it should also be a bound line, therefore it shows potential and abandons the last element of the capacity if the capacity is fulfilled.

If enough to keep line with 'set-like' behavior, you can only duplicate entries I do not want to accept, so I think the sub-class priority question and plus () , addAll () and offers () as follows:

@ Override Public Boolean Offer (ee) {if (in (e)) {return false; } And {return super.offer (e); }}

BTW - add () call offer () internally, so maybe it's only to override There is enough offer () method and check there.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -