Re: Subclass final class (Boolean) ?
Re: Subclass final class (Boolean) ?
- Subject: Re: Subclass final class (Boolean) ?
- From: Chuck Hill <email@hidden>
- Date: Mon, 28 Aug 2006 11:04:58 -0700
On Aug 27, 2006, at 7:28 AM, Ken Anderson wrote:
OK, I'm a little annoyed here because I find the whole concept of
'final' to be ridiculous.
I can see the use of this concept. For example, you may have a
legitimate reason for making your LicenseEvaluator class final. But
the Java API writers have used it with wild conceit. "Our String is
so perfect, nobody will ever need to extend it!". That and the
rampant use of private methods (as opposed to protected) mar many
Java APIs.
I would like to subclass Boolean so that I can initialize it (class
method) with a short string (valueOf:"t" instead of valueOf:"f")
and also to return "t" and "f" for toString (or some other method
like toShortString()).
Unfortunately, java.lang.Boolean is marked as final. Is there any
way to get around that?
No, not if you exclude hacking Java by fiddling with the bootclasspath.
Chuck
To give a little background, I would like to have a custom
WebObjects type where I can declare the factory method to create
the instance, and the method to call to get back the string
instance. I want to make it a single character so that I can use a
string field with length=1 instead of length=5 (saving a lot of
space).
Oh, and yet another reason I want categories from Objective-C in
Java...
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden