, does anyone else agree/disagree?
On Tue, 2003-03-11 at 12:07, Rodney Waldhoff wrote:
Can someone clarify the advantage of:
typedBag(bag, String.class)
over
predicatedBag(bag, new InstanceofPredicate(String.class));
?
On Mon, 11 Mar 2003, grumpoxl wrote:
The patches will take
Is there any interest in:
1) A mechanism for pooling Integers, Floats, Doubles, etc. as they are
created, to conserve memory. For example, instead of having:
new Integer(1)
scattered throughout the code, there could be a NumberPool class which
would allow:
NumberFactory.createInteger(1)
the
-
From: grumpoxl [EMAIL PROTECTED]
To: Jakarta Commons Developers List [EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 9:44 AM
Subject: [lang] Pooled and mutable numbers.
Is there any interest in:
1) A mechanism for pooling Integers, Floats, Doubles, etc. as they are
created
:
From: grumpoxl [EMAIL PROTECTED]
I don't see the PredicateUtils class, I'm assuming by saying with a
little tweaking in CVS you mean it has to be created.
No, PredicateUtils exists in [lang]. The tweaking means that it implements
the same interface, but in a different package. Simple enough
Is there any interest in creating typed Collections? Even though it
looks like Java is providing generics with 1.5, this could serve as a
good holdover until then,
- a TypedCollection(Integer.class) would only allow Integers to its add
methods
- a TypedMap(String.class, Integer.class) would
It seems like a waste of time to write/maintain code that will be obsolete
quite soon. I don't find casting collection objects to be terribly painful
and 1.5 will provide the function you would be coding.
David
It is true that Java 1.5 will include generics, and that any typed
If you read the paragraph that starts with...
I wasn't proposing to get rid of the casting involved when retrieving
Objects
You'll see that what I'm suggesting has nothing to do with casting.
Also, downloading a prototype implementation of the java compiler, which
requires the 1.4 compiler to
My idea was to provide 3 constructors;
TypedCollection() - no type specified, uses default class (Object) and
default Collection type (ArrayList)
TypedCollection(Collection) - no type, but uses specified collection
TypedCollection(Class) - uses specified type and default Collection