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

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

iphone - How do I make a UIPickerView in a UIActionSheet -