Stephen Colebourne wrote:
This misunderstands the BoundedCollection interface, which is an interface
providing extra information about collections with a maximum limited size..

Well, I understand but I used the FixedSizeMap because it also implements BoundedMap. So I assumed that a FixedSizeMap means the boundary is always reached. Did I get this wrong?

// create a buffer that implements the BoundedCollection interface
BoundedCollection buffer = new BoundedBuffer(16);

// create a BoundedMap Map m = MapUtils.fixedSizeMap(new HashMap());

// synchronize it, but this loses the BoundedCollection interface
Collection sync = SynchronizedCollection.decorate(buffer);

// synchronize it Map sm = MapUtils.synchronizedMap(m);

// get back to the bounded collection interface
BoundedCollection coll = UnmodifiableBoundedCollection.decorateUsing(sync);

But why is this needed? Both decorators are still being used. ...although the object itself does not implement the BoundedMap/Collection interface anymore. So the UnmodifiableBoundedCollection is only to bring the interface back?

Is that what you mean?

cheers
--
Torsten



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to