> I have an immutable object that needs to hold (Among the rest) two
> "Object" objects
[quoted text clipped - 5 lines]
> BTW: I can't know what is the type of the Object before run-time...
> (that's way it is an "Object")
No.
I suggest using a wrapper interface that can be copied, and a wrapper
implementation for each type of object that you want your immutable to hold.
Tom hawtin
Hendrik Maryns - 02 Apr 2007 11:09 GMT
Tom Hawtin schreef:
>> I have an immutable object that needs to hold (Among the rest) two
>> "Object" objects
[quoted text clipped - 11 lines]
> implementation for each type of object that you want your immutable to
> hold.
Indeed, for inspiration, have a look at Collections.unmodifiableX(X)
where X is Set Collection or Map. Or maybe that is what you need?
H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html