Michael Smith
6b320e8afe
Fixed to have SequencedHashMap throw a ConcurrentModificationException
...
from its iterators if the map is modified through something other than
the iterator.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130700 13f79535-47bb-0310-9956-ffa450edef68
2002-05-09 03:20:59 +00:00
Michael Smith
09e7a4b86e
Fixed to ensure that get(Object) won't add a mapping to a null value
...
when one didn't exist before. That is, if containsKey(foo) returns
false, then get(foo) will not change that.
Added serial version UID to maintain backwards compatibility. The auto
generated serialization UID differs from the released version because
of the addition of a new method.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130699 13f79535-47bb-0310-9956-ffa450edef68
2002-05-09 03:10:46 +00:00
Morgan James Delagrange
33f0ab0d46
added test for concurrent modifications
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130698 13f79535-47bb-0310-9956-ffa450edef68
2002-05-08 18:11:36 +00:00
James Strachan
bccc0cbfa2
Added Stephen's new PredicateUtils submission. Looks good; just need some unit test cases ;-)
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130693 13f79535-47bb-0310-9956-ffa450edef68
2002-05-02 06:17:19 +00:00
Morgan James Delagrange
f3eef9b91d
fixed strage javadoc wording per patch
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130692 13f79535-47bb-0310-9956-ffa450edef68
2002-04-16 21:15:13 +00:00
Morgan James Delagrange
1f59eea6bc
A FilterIterator that skips over Objects that have already been returned
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130690 13f79535-47bb-0310-9956-ffa450edef68
2002-04-09 16:43:29 +00:00
Morgan James Delagrange
6c21eb2aa1
ListIteratorWrapper allows Iterators to simulate ListIterator behaviour
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130689 13f79535-47bb-0310-9956-ffa450edef68
2002-04-09 16:40:58 +00:00
Morgan James Delagrange
134caec9ec
fixed doco bug
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130688 13f79535-47bb-0310-9956-ffa450edef68
2002-04-09 16:33:40 +00:00
Morgan James Delagrange
38e0a5c241
fixed documentation error - IteratorChain is not currently Serializable
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130687 13f79535-47bb-0310-9956-ffa450edef68
2002-04-08 23:59:58 +00:00
Morgan James Delagrange
baf631663d
An IteratorChain is a sequence of Iterators called until all Iterators are
...
exhausted
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130686 13f79535-47bb-0310-9956-ffa450edef68
2002-04-08 23:39:01 +00:00
Morgan James Delagrange
59a50d1b9b
List constructors for ComparatorChain no longer perform defensive copies
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130676 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 21:20:53 +00:00
Michael Smith
80ea89fd05
Renamed AbstractBag to DefaultMapBag. The implementation is more of a
...
"default map based implementation" and differs in design from the
AbstractSet, AbstractMap classes which do not make assumptions about
how they might be implemented. To be consistent with JDK AbstractX
collections, an AbstractBag class should just be providing default
implementations that could be used regardless of underlying storage
mechanism. For example, the add(Object) method would call the abstract
add(Object,int) method passing the object and 1. Since this
implementation assumes a Map based storage for the Bag, it does not
follow the AbstractX pattern, and thus has been renamed. There is
still room for future addition of an AbstractBag that does not assume
a storage data structure.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130675 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 05:50:57 +00:00
Michael Smith
e25229d271
Updated javadoc
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130674 13f79535-47bb-0310-9956-ffa450edef68
2002-03-24 22:00:55 +00:00
Michael Smith
63cf00bf0e
Made BeanMap.values() and BeanMap.keySet() unmodifiable. This brings it more
...
in line with the Map contract where any modifications will throw
UnsupportedOperationException rather than allow modifications that are not
reflected in the underlying map. This also keeps values(), keySet() and
entrySet() consistent with each other.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130673 13f79535-47bb-0310-9956-ffa450edef68
2002-03-24 21:53:27 +00:00
Michael Smith
302cc6fd28
Rather than throw a NullPointerException during hasMoreElements or nextElement
...
when no array is passed to the constructor, treat a null to the constructor as
an empty array.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130672 13f79535-47bb-0310-9956-ffa450edef68
2002-03-24 21:50:24 +00:00
Morgan James Delagrange
6d367b97f7
javadocs
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130671 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 17:11:01 +00:00
Michael Smith
11328e166e
Submitted by Daniel Rall:
...
"The definition of "delegate" at the beginning of the header JavaDoc is
mostly meaningless, since the class was renamed to and committed with
the name ProxyMap."
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130670 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 03:31:09 +00:00
Morgan James Delagrange
79b299a70c
javadocs
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130669 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:09:16 +00:00
Michael Smith
f62b8ed900
Fix javadoc warnings
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130668 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 05:16:24 +00:00
Michael Smith
d0d74a4e1a
Fix deviation from Comparator contract
...
[sgn(compare(x, y)) == -sgn(compare(y, x))]
Eliminate multiplication by switching order of objects passed to
underlying comparator.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130667 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 00:25:37 +00:00
Morgan James Delagrange
54c23b2da3
now throws an exception for comparisons on an empty chain and
...
added no-op constructor
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130665 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 22:25:58 +00:00
Michael Smith
fedb457600
Fixed API to use new interfaces defined by PriorityQueue. Now supports
...
objects that do not implement comparable.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130664 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 13:19:13 +00:00
Michael Smith
742ffb2d8d
Added static method to retrieve a shared instance.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130663 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 05:09:05 +00:00
Michael Smith
ea8731a374
Fixed copyright date in license of TestBinaryHeap and added myself as an
...
author for BinaryHeap for my recent changes.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130662 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 04:49:00 +00:00
Michael Smith
d5ca0eeb3c
Changed PriorityQueue and BinaryHeap to allow objects that do not
...
implement Comparable. BinaryHeap implements this by accepting an
optional Comparator in its constructor. If no comparator is specified,
the object's natural ordering is used (i.e. it is cast to a Comparable
and compared using its compareTo method)
Also added basic tests for BinaryHeap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130661 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 04:34:18 +00:00
Michael Smith
d6a2418582
Documentation updates and new test case for specifying null to the
...
ArrayIterator constructor or the setArray(Object) method.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130659 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 01:33:12 +00:00
Jeff Turner
67282865fa
Fix javadoc warning
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130657 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 01:18:09 +00:00
Michael Smith
25e0dd13fd
If object is not an array, fail on from the constructor or from
...
setArray rather than from hasNext or next. This gives a more
fail-fast behavior.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130656 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 00:54:34 +00:00
Morgan James Delagrange
236ad31fbd
using the setArray(Object) method no longer produces an out of bounds
...
exception
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130654 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 00:05:16 +00:00
Morgan James Delagrange
00be90bccc
deprecated ArrayEnumeration
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130653 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 23:51:05 +00:00
Morgan James Delagrange
6c8d4b8fc7
javadoc fix
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130652 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 17:33:52 +00:00
Morgan James Delagrange
09451a1f93
fixed bad linefeeds
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130651 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 17:33:23 +00:00
Morgan James Delagrange
312f353b21
added for collections 2.0
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130646 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 05:36:58 +00:00
Michael Smith
008dc5f8da
Remove incorrect comment about using hashCode to determine whether
...
objects in the bag are equal.
Fix numerous javadoc cross reference problems.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130642 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 06:00:20 +00:00
Michael Smith
cfb9865f41
Removed bad line-endings (multiple ^Ms).
...
Thanks to Christopher Elkins.
see: http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg04102.html
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130641 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 05:40:31 +00:00
Michael Smith
7733e2f193
Fixed typo in documentation.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130640 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 05:24:58 +00:00
Michael Smith
33ac6121a5
Fixed bugs where methods failed when there is no bean set for the bean map.
...
Fixed entrySet() to return a set containing Map.Entry objects with readable
properties as keys. This fixes the test case error, and a couple of the test
case failures (and uncovers a couple more test case failures)
Fixed clone method to allow subclasses to clone properly. This requires a
non-backwards compatible change where the clone method now declares it throws
CloneNotSupportedException. See:
http://www.javaworld.com/javaworld/jw-01-1999/jw-01-object.html Seeing how
BeanMap never directly implemented Cloneable anyway, and this is for a major
revision, I don't see this changing being much of a problem.
Since clone() declares it throws CloneNotSupportedException, that exception is
now used to indicate a problem when attempting to clone (rather than
UnsupportedOperationException, or other RuntimeException).
Added a small test for testing BeanMap clone.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130638 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 04:36:18 +00:00
Michael Smith
fa43060230
Removed ^M's from file because they were causing line numbers to be
...
reported incorrectly when trying to track down failing test cases.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130637 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 04:15:49 +00:00
Morgan James Delagrange
5155b93eb0
added complete JavaDocs, added isLocked() and size() methods, made
...
checkLocked() method private
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130633 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 19:18:56 +00:00
Morgan James Delagrange
f247986918
changed List, BitSet constructor to perform a defensive copy into a
...
new List
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130632 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 23:48:59 +00:00
Morgan James Delagrange
c55fe26ab9
added separate methods for setting/changing sort order on a Comparator
...
in the chain
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130631 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 23:40:43 +00:00
Morgan James Delagrange
5ae848724e
class that allows you to chain comparators together for SQL-like
...
sorting...more Javadocs to come
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130628 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 23:29:24 +00:00
Morgan James Delagrange
520dc72714
make all Comparators Serializable
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130624 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 19:18:49 +00:00
Morgan James Delagrange
663401641b
javadoc clarification
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130622 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 19:00:33 +00:00
Morgan James Delagrange
28a71ba3ba
javadoc clarification
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130621 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 18:58:05 +00:00
Morgan James Delagrange
0d95977a69
javadoc clarification
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130620 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 18:56:53 +00:00
Morgan James Delagrange
468110ea08
moved back to util for further development
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130618 13f79535-47bb-0310-9956-ffa450edef68
2002-03-01 17:10:06 +00:00
Morgan James Delagrange
5e06b23d56
Seem to have consensus on removing this for now
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130617 13f79535-47bb-0310-9956-ffa450edef68
2002-02-28 23:35:53 +00:00
Morgan James Delagrange
c095f1aac1
javadoc
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130616 13f79535-47bb-0310-9956-ffa450edef68
2002-02-28 18:06:39 +00:00
Morgan James Delagrange
361f3483b5
comparators moved from the commons-sandbox/util component
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130615 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 22:42:31 +00:00
Morgan James Delagrange
8d39019497
Fixed javadoc error
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130609 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 21:30:40 +00:00
Rodney Waldhoff
224a627029
fixing bug in FilterListIterator, adding test for it
...
javadoc fixes to FilterListIterator
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130599 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 17:28:55 +00:00
Rodney Waldhoff
e238eff5de
adding ProxyListIterator, FilterListIterator, and tests
...
removing unneeded import from ProxyIterartor, javadoc tweaks
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130582 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:53:20 +00:00
Henri Yandell
b7713ef824
StringStack comes from Commons.Utils.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130571 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:52:02 +00:00
Henri Yandell
2bd797f65d
Merged the Commons.Utils MapUtils in. It consisted of:
...
safeAddToMap method.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130570 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:50:23 +00:00
Michael Smith
94c4dca82f
Fix test failure for BeanMap.clear()
...
Documented deviation in behavior from Map.clear()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130562 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 07:00:30 +00:00
Michael Smith
4d9246c82a
Updated my email address.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130558 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:58:17 +00:00
Michael Smith
91e030ff08
Fixed the following Bag related problems:
...
- In Bag.java, the statement "If the bag contains less than i occurences,
the item item will be removed from the unique set" implies that if the bag
contains 5 occurences and i is 5, (5 is not less than 5) then the item will
not be removed from the unique set, even though there should be no more
occurances in the bag.
- In AbstractBag.java, the documentation does not specify exactly what a
subcless needs to do to extend AbstractBag to make a concrete subclass.
- AbstractBag.add(Object,int) has two calls to getCount(o), when only one
is necessary. This wastes a few cycles to perform method invocations, a
map lookup, a cast, and a few comparisons.
- The AbstractBag.equals(Object) method will incorrectly throw a
NullPointerException if a null value is passed. The Object.equals(Object)
API specifies "For any non-null reference value x, x.equals(null) should
return false".
- The AbstractBag.equals(Object) method will only work if the object
passed in extends AbstractMap or implements Map. Neither of these facts
is documented, and neither is correct. The contract for
Object.equals(Object) states: "for any reference values x and y,
x.equals(y) should return true if and only if y.equals(x) returns true. ".
Returning true when the argument is a Map is incorrect since he reverse
(the map checking to see if its equal to the bag) will most certainly be
false. The same can be said for AbstractMap. A subclass of AbstractMap
may add extra data to be stored within the Bag that must also be compared
for them to be equal. The reverse comparison (specialized subclass equals
basic abstract bap) will fail. You can read more about this in a three-
year old, but still valid java world article:
http://www.javaworld.com/javaworld/jw-01-1999/jw-01-object.html
- if AbstractBag.remove(Object,int) is called passing in 0 as the number
to remove and specifying an object that exists in the bag, true will be
returned from the method. Per the Bag API specification, true should only
return when an object is actually removed. Since no objects are removed,
false should be returned instead. Additionally, if a negative number is
specified, not only is the object not removed, but object(s) are *added*
(well, in the sense that it is equivalent of calling add(o, -i))
- the uniqueSet() method returns the set of unique objects, however the
set is modifiable. If the underlying map implementation has the set
backed by the map (as per the map contract -- so it should), then elements
can be removed from the unique set and have them removed from the
underlying map as well. This causes consistency problems with the Bag
since _total will then be incorrect.
- in extractList(), getCount(current) is called each time through the
inner loop, adding lots of extra overhead. Reversing the loop (starting
at the count and going down to 0) eliminates the excess overhead.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130557 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:39:53 +00:00
Michael Smith
5bf5481408
Added documentation, and updating formatting of some documentation
...
(i.e. put "code" within <code>...</code>)
Added check for a valid capacity argument passed to constructor.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130556 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:16:19 +00:00
Michael Smith
6bb40f4086
Implement Externalizable in SequencedHashMap
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130555 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 03:17:40 +00:00
Michael Smith
2af7a322ef
Odd how that compiled for me before my commit, but it doesn't
...
afterwards (for obvious reasons)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130554 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 02:37:56 +00:00
Michael Smith
ef5aa20db3
There is no backwards compatibility issue since this class is new
...
since collections 1.0. Therefore, since the entire Map interface
is implemented, there's no reason to inherit from HashMap.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130553 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 02:34:59 +00:00
Michael Smith
90646843f9
Fix a NullPointerException when an object passed to an entrySet method is not mapping found in the map. Exhibited with entrySet().remove(Object) and entrySet().contains(Object)
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130546 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 13:46:25 +00:00
Morgan James Delagrange
cd6254ae22
fixed line feed problem over whole file
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130537 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 18:30:36 +00:00
Morgan James Delagrange
ca6c97a99a
removed unnecessary else block and fixed indenting
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130536 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 18:05:07 +00:00
Morgan James Delagrange
89417ef747
LRUMap reimplemented, based on SequencedHashMap
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130535 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 18:01:34 +00:00
Morgan James Delagrange
3b9b229b36
complete re-implementation of SequencedHashMap submitted by
...
Michael Smith
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130532 13f79535-47bb-0310-9956-ffa450edef68
2002-02-18 20:34:57 +00:00
Morgan James Delagrange
c9cc92c63e
LRUMap does not support concurrent access to any of its methods
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130523 13f79535-47bb-0310-9956-ffa450edef68
2002-02-14 21:24:32 +00:00
Morgan James Delagrange
f22d9bce8c
added contract to LRUMap - subclasses can override removeLRU()
...
and remove(Object) to manipulate objects on their way out of the cache
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130522 13f79535-47bb-0310-9956-ffa450edef68
2002-02-14 20:58:48 +00:00
Morgan James Delagrange
b0a305ab05
added fully qualified package names for imports
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130520 13f79535-47bb-0310-9956-ffa450edef68
2002-02-14 20:21:49 +00:00
Morgan James Delagrange
02bc992242
fixed bubble sort, so that the number of elements in the bubble sort
...
will always equal the size of the LRUMap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130518 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 23:07:31 +00:00
Morgan James Delagrange
c5c64c02d3
fixed IndexOutOfBoundsException
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130515 13f79535-47bb-0310-9956-ffa450edef68
2002-02-13 21:03:20 +00:00
James Strachan
328f30989e
Patched the LRUMap so that remove() does indeed remove items from the bubble list
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130512 13f79535-47bb-0310-9956-ffa450edef68
2002-02-10 12:56:39 +00:00
James Strachan
25c1cb6b4a
Updated all the licences to the full long form and ensured that the copyright notice extends to 2002. Also applied Michael Smith's patch for FilterIterator, Closure, DefaultMapEntry and LRUMap
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130511 13f79535-47bb-0310-9956-ffa450edef68
2002-02-10 08:07:42 +00:00
James Strachan
4b266ff8bc
Applied patch submitted by Michael Smith that clarifies the description of the FilterIterator
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130510 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 16:27:40 +00:00
Craig R. McClanahan
6a5c4a72c6
Committed the DoubleOrderedMap class and associated unit tests (gotta love
...
it when the unit test source is 50% longer than the class being tested :-).
The only change I made was to use the long-form version of the Apache
license -- according to the Apache board, that is the only acceptable
approach at the moment. Any remaining classes in commons-collections (or
elsewhere) using the short form license should be updated.
Submitted by: Marc Johnson <marc_johnson27591@hotmail.com>
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130509 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 04:36:08 +00:00
Henri Yandell
3d6c8c5fab
An empty iterator. It is immutable and always the same object instance.
...
Submitted by: Christopher Elkins <chrise@scardini.com>
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130508 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 17:15:33 +00:00
James Strachan
51a5b46632
Applied patch submitted by Richard Wan that containsKey() took a String by mistake
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130507 13f79535-47bb-0310-9956-ffa450edef68
2001-11-02 14:44:35 +00:00
Henri Yandell
21500f60e7
Patch that stops next() continually returning null if hasNext is not
...
called in the standard way. ie)
(cf: "Juozas Baliuka" <baliuka@mwm.lt>)
while(true) {
filterIterator.next();
}
This should eventually throw NoSuchElementException, but it returns null
forever.
Submitted by: Jan Sorensen <jan.sorensen@aragost.com>
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130505 13f79535-47bb-0310-9956-ffa450edef68
2001-10-19 20:18:21 +00:00
Jason van Zyl
30a8d35e54
- adding ${variable} interpolation to the getString() methods. the
...
code was taken from the jetspeed codebase.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130503 13f79535-47bb-0310-9956-ffa450edef68
2001-09-21 03:14:40 +00:00
James Strachan
71a401b27b
Added MultiMap and MultiHashMap implementation submitted by Chris Berry together with a JUnit test case
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130502 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 10:41:39 +00:00
James Strachan
40bdd8fe80
Added Daniel Rall's SequencedHashMap patch and ported the JUnit test case over to use assertTrue() rather than assert().
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130501 13f79535-47bb-0310-9956-ffa450edef68
2001-09-17 16:43:49 +00:00
James Strachan
f9f92677a9
Added Bay's helper methods to CollectionUtils
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130500 13f79535-47bb-0310-9956-ffa450edef68
2001-08-29 16:10:29 +00:00
James Strachan
a10c6b0142
Added Daniel Rall's patch to support remove() from the EnuemerationIterator
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130499 13f79535-47bb-0310-9956-ffa450edef68
2001-08-29 15:48:42 +00:00
James Strachan
d08fa6d71e
Added Bag interface, implementations and JUnit test cases as submitted by Chuck Burdick
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130498 13f79535-47bb-0310-9956-ffa450edef68
2001-08-29 15:28:07 +00:00
James Strachan
66c451d618
Patched ArrayIterator to use java.lang.reflect.Array so that it can support arrays of primitive types such as int[]
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130497 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 12:04:40 +00:00
James Strachan
530049b41c
Backed out ArrayIterator change to use reflection rather than use Object[]
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130496 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 10:50:01 +00:00
James Strachan
ea64efd6dc
Patched ArrayIterator so that it can work with any type of array, not just Object[] instances
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130495 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 09:05:26 +00:00
James Strachan
8c44a71208
Added SingletonIterator for iterating over a single value together with a JUnit test case
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130493 13f79535-47bb-0310-9956-ffa450edef68
2001-08-22 07:43:53 +00:00
Rodney Waldhoff
54345a5c91
committing ungenerated parts of documentation patch from Chuck Burdick
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130492 13f79535-47bb-0310-9956-ffa450edef68
2001-08-17 23:00:26 +00:00
James Strachan
4a2e49fd8d
Applied Mauricio's patches to the ArrayIterator and added his patches to TestArrayIterator also
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130487 13f79535-47bb-0310-9956-ffa450edef68
2001-06-05 07:20:10 +00:00
James Strachan
2ecede5902
Patched the select(inputCollection, predicate, outputCollection) method so that it does not return a variable, to avoid any confusion with the select(inputCollection, predicate) method which returns the outputCollection.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130486 13f79535-47bb-0310-9956-ffa450edef68
2001-05-22 15:53:06 +00:00
Craig R. McClanahan
a36442f0d0
Work around a problem reported by the VAJ Java compiler, caused by the
...
fact that the superclass already has a private class named Iterator.
Submitted by: Costin Cozianu <Costin.Cozianu@cis.canon.com>
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130485 13f79535-47bb-0310-9956-ffa450edef68
2001-05-20 21:03:30 +00:00
Rodney Waldhoff
3761b55144
I pretty sure this fixes bug 1729 ( http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1729 ) but I don't have an environment to test it. It certainly doesn't break anything.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130484 13f79535-47bb-0310-9956-ffa450edef68
2001-05-18 00:12:45 +00:00
Rodney Waldhoff
ffe28c43e0
Deprecating. I'd like to remove this class, if no one has any issues.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130482 13f79535-47bb-0310-9956-ffa450edef68
2001-05-16 22:19:23 +00:00
James Strachan
284b6f5477
Added Mauricio S. Moura's patch to ArrayIterator such that next() calls move the iterator along rather than calls to hasNext(). I've also added a JUnit test case to demonstrate it in action and validate that it works correctly.
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130481 13f79535-47bb-0310-9956-ffa450edef68
2001-05-14 10:42:53 +00:00
Geir Magnusson Jr
8ab1fd1633
javadoc update. Thanks to Jon Stevens for pointing it out.
...
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130480 13f79535-47bb-0310-9956-ffa450edef68
2001-05-13 21:46:22 +00:00
Geir Magnusson Jr
1688a5a244
Fixed the problem reported by Thomas Fahrmeyer <thomas.fahrmeyer@einsurance.de>
...
where ExtendedProperties would re-process data when making a subset. Hope no one
was depending on that :)
Also adjusted the testcase to test this.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130474 13f79535-47bb-0310-9956-ffa450edef68
2001-05-10 00:40:09 +00:00
James Strachan
485615107d
Added new Map implementations and Closure classes
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130471 13f79535-47bb-0310-9956-ffa450edef68
2001-05-06 11:04:25 +00:00
Rodney Waldhoff
2a069edb7e
importing classes referenced in javadoc comments (javadoc won't find them otherwise)
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130469 13f79535-47bb-0310-9956-ffa450edef68
2001-05-04 16:33:18 +00:00
Rodney Waldhoff
3f66e516a7
minor javadoc fixes
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130468 13f79535-47bb-0310-9956-ffa450edef68
2001-05-04 16:32:17 +00:00
Geir Magnusson Jr
2a49159056
A few minor changes :
...
1) replaced with the current version from velocity's CVS - this is a few
changes by dan
2) added the recent patch from Ilkka for dealing with encoded properties
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130456 13f79535-47bb-0310-9956-ffa450edef68
2001-05-04 02:22:48 +00:00
Rodney Waldhoff
1e8a31f417
minor fixes to adhere more closely to the java.util.List contract
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130453 13f79535-47bb-0310-9956-ffa450edef68
2001-04-26 00:05:47 +00:00
Rodney Waldhoff
256420016e
adding CollectionUtils and tests for it
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130450 13f79535-47bb-0310-9956-ffa450edef68
2001-04-24 18:48:38 +00:00
Rodney Waldhoff
b8ed8bbd5e
committing several files from Peter Donald and Avalon
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130448 13f79535-47bb-0310-9956-ffa450edef68
2001-04-22 19:56:37 +00:00
Craig R. McClanahan
fff00791ed
Change parentage of these classes so that they subclass ArrayList,
...
HashMap, and TreeMap respectively. This improves the ability to
substitute "fast" versions for the use of the regular collection classes.
Implement clone(), equals(), and hashCode() methods in accordance with the
contracts specified in the Collections classes APIs.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130444 13f79535-47bb-0310-9956-ffa450edef68
2001-04-21 12:19:57 +00:00
Jason van Zyl
30681261f3
- adding some utilities from struts into the collections packages
...
along with some (admittedly weak for now) tests.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130442 13f79535-47bb-0310-9956-ffa450edef68
2001-04-16 22:42:04 +00:00
Geir Magnusson Jr
73733206b9
Applied Scott Sanders' patch restoring the peek(n) method.
...
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130441 13f79535-47bb-0310-9956-ffa450edef68
2001-04-16 22:39:21 +00:00
Geir Magnusson Jr
596afd4f5a
Moved and renamed - was originally from Velocity CVS (which came from elswhere...)
...
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130438 13f79535-47bb-0310-9956-ffa450edef68
2001-04-16 05:01:03 +00:00
Craig R. McClanahan
004d5e672e
Add an unsynchronized implementation of the Stack API (extends ArrayList
...
instead of Vector) for faster stack processing in single threaded
environments.
TODO: Finish the unit tests (coming soon).
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130436 13f79535-47bb-0310-9956-ffa450edef68
2001-04-14 19:32:38 +00:00
Rodney Waldhoff
13a119de0b
Initial revision
...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130432 13f79535-47bb-0310-9956-ffa450edef68
2001-04-14 15:38:58 +00:00