Is there a standard Java (1.5+) implementation (i.e. no 3rd party) of a collection which allows me to glue several collections into one?
Here's a sketch, of how it works:
final SomeCollection x = new SomeCollection();
final ArrayList a = new ArrayList();
a.add("first");
assert(a.size() == 1);
x.embed(a); // don't know for sure, if this exists.
assert(x.size() == 1);
a.add("second");
assert(a.size() == 2);
assert(x.size() == 2); // the other array is used as a backend-collection.
final ArrayList b = new ArrayList();
b.add("third");
assert(b.size() == 1);
x.embed(b);
assert(x.size() == 3); // x is a combination of the other two lists.
Thanks!