commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@rd.gen.nz
Subject [collections] [patch] NodeCachingLinkedList
Date Fri, 13 Dec 2002 21:43:05 GMT
Hi

Here is a patch to resolve the license issues with
NodeCachingLinkedList. Included in this patch is:

- CommonsLinkedList, a version of java.util.LinkedList that we can
  distribute with [collections].

  A few points about this class:

  - Is the name ok? I couldn't think of anything else to distinguish
    it from the standard implementation.

  - It is package visible, perhaps it should be public.

  - It extends LinkedList rather than AbstractSequentialList. Since it
    doesn't override every method of List there will be problems if
    LinkedList overrides more methods in the future. (This was a
    problem with the old implementation of NodeCachingLinkedList too.)

    Also, extending LinkedList takes up a little bit more memory.

  - It will probably be a little slower than LinkedList since I have
    made an effort to break out common code rather than inlining
    everything. The difference should be very small.

- NodeCachingLinkedList which overrides several of CommonsLinkedList
  methods to allow caching of nodes. Jeff may wish to look at this to
  see if I've written it correctly. Of particular note:
  
  - The default maximum cache size is now 20, down from 1000000. It is
    still possible to change this maximum for a particular instance.

  - It is serializable.

- TestLinkedList, for testing classes that extend LinkedList. Being
  able to write this class is one good reason for CommonsLinkedList to
  extend LinkedList!

- Tests for CommonsLinkedList and NodeCachingLinkedList.

- Serialized versions of CommonsLinkedList and NodeCachingLinkedList
  that can be placed in data/test.

- Patch to TestObject.getCompatibilityVersion() to use a String
  version instead of an int version. This allows version strings like
  "2.1" or "2.2". This also required changes to several other test
  cases which overrode the method.
  
BTW, what is the best way to submit a patch which includes new files? I used
'diff' with the -N option, is there a way using 'cvs diff'?

Rich

Mime
View raw message