|
|
@@ -16,6 +16,8 @@ import net.ranides.assira.collection.arrays.ArrayAllocator;
|
|
|
* A generic red-black tree set implementation.
|
|
|
*
|
|
|
* <P>The iterators can be safely cast end a {@linkplain java.util.ListIterator list iterator}.
|
|
|
+ *
|
|
|
+ * @param <K> type of element
|
|
|
*/
|
|
|
@SuppressWarnings({
|
|
|
"PMD.AvoidReassigningParameters"
|
|
|
@@ -74,7 +76,13 @@ public class RBTreeMultiSet<K> extends ARBTreeSet<K> implements MultiSet<K> {
|
|
|
add(values.next());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a new tree set using elements provided by a type-specific iterator and comparator.
|
|
|
+ *
|
|
|
+ * @param values values
|
|
|
+ * @param comparator comparator
|
|
|
+ */
|
|
|
public RBTreeMultiSet(Iterator<? extends K> values, Comparator<? super K> comparator) {
|
|
|
this(comparator);
|
|
|
while (values.hasNext()) {
|