set - Alternative to using TreeSet in java? -


i'm looking set class use given comparator removeall().

i using treeset after few hours ripping hair out trying figured out why removeall() not removing found this...

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4730113

long story short removeall() uses equals() method. (but oddly enough remove() method doesn't...)

i want set duplicates removed, preferably comparator not required, , can't override equals method b/c need other logic. , avoid making loop calls remove() on elements doesn't confuse me in future (or else).

does such animal animal exist?

treeset.removeall method accepts collection<?> parameter. objects in collection can of type, not comparable objects. need make own set different method. note bug resolution "won't fix"


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -