Craig P. Motlin

Results 152 comments of Craig P. Motlin

A removal from the middle of an IntList would turn Set.remove() into a linear time operation, at least with the naive/obvious implementation. In fact, any removal is complicated. On Sat,...

Ideally, `MapIterable.keySet()` would return `SetIterable`. That's not easy to do until MutableMapIterable.keySet() and overrides return MutableSetIterables.

Eclipse Collections has the interfaces StackIterable, MutableStack, ImmutableStack. I'd imagine adding QueueIterable, MutableQueue, ImmutableQueue. Rather than pop() and push(), I think we'd have methods like offer()/poll(), add()/remove(). I'd prefer names...

Do you have an example when you might use this? On Fri, Dec 1, 2017 at 6:12 PM Nikhil Nanivadekar wrote: > This is related to #409 > > >...

@donraab rebased and fixed the checkstyle violation

I like the idea overall. I don't see much point in using the Mutable interfaces specifically, when we wrap them in unmodifiable wrappers. We could use ListIerable instead of MutableList...

It's still valid! The conflicts are real bugs that should be fixed. You're right about interfaces that can't extend a class.

StackIterable implements OrderedIterable. If we do this for primitive collections, we should do it for regular collections. I don't think we should do this at all. StackIterable only allows iteration...

That makes sense. Similarly, ArrayStack could implement ReversibleIterable.

Sure, you could also use toList(). Those are O(n) operations, and I think the signatures make it clear that they take O(n). I'd want to avoid supporting getLast(), asReversed() or...