I just pushed a ClassMap class in. Uses inheritence in the get, so you can
do:

map.put(Number.class, new NumberConverter());

Converter c = (Converter)map.get(Float.class);

assuming a Converter class.

It doesn't do anything fancy with Integer.TYPE. ie) claiming that that
extends Number.class etc. Any views?


Clearing out my collections package...
Other things:

I still need to add an isSorted to CollectionUtils, will go ahead and do
that at some point. Making myself hold back until I have a unit-test is
almost like hard work :)

I have a SortedIterator class. Basic usage being:
..
Iterator iterator = ...
SortedIterator si = new SortedIterator(iterator, new SomeComparator() );
..
Then it reads that iterator out in sorted order. Obviously has to suck it
into memory internally. Anyone think this is of use?

OrderedSet -> Basically a List which doesn't allow duplicates.
LimitedList -> A List which maintains a fixed max length.
SortedLimitedList -> A List which uses a Comparator to maintain a sorted
                     max length. Useful to do a quick sort to find the
                     first N elements of a list of length L.
                     <Insertion Sort>
ProxySet/List. Any reason not to have these? [or even ProxyCollection]?

typed.*  a Map/List/Set wrapper which enforces the Type of the value or
key. So you'd do:
..
List list = new TypedList(Integer.class)
..
and it will throw an Exception if u pass the wrong thing in.


That's all that leaps out as mature for now. Apologies if I'm repeating
myself with any of these, am attempting to clean out my collections
package so I can force myself to use Commons Collections more.

Will slowly add things as I get time and unit tests together.
Or at least the ones that aren't blown apart.

Hen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>

Reply via email to