scolebourne 2004/05/26 14:56:05
Modified: collections/src/java/org/apache/commons/collections/list
TreeList.java
collections/src/java/org/apache/commons/collections/map
AbstractHashedMap.java AbstractLinkedMap.java
Flat3Map.java
collections/src/java/org/apache/commons/collections
MultiHashMap.java
Log:
Replace IteratorUtils calls with direct implementation calls
Revision Changes Path
1.3 +2 -2
jakarta-commons/collections/src/java/org/apache/commons/collections/list/TreeList.java
Index: TreeList.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/list/TreeList.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TreeList.java 12 May 2004 23:24:45 -0000 1.2
+++ TreeList.java 26 May 2004 21:56:05 -0000 1.3
@@ -135,7 +135,7 @@
*/
public ListIterator listIterator(int fromIndex) {
// override to go 75% faster
- // cannot use IteratorUtils.EMPTY_ITERATOR as iterator.add() must work
+ // cannot use EmptyIterator as iterator.add() must work
checkInterval(fromIndex, 0, size());
return new TreeListIterator(this, fromIndex);
}
1.18 +7 -6
jakarta-commons/collections/src/java/org/apache/commons/collections/map/AbstractHashedMap.java
Index: AbstractHashedMap.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/AbstractHashedMap.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- AbstractHashedMap.java 27 Apr 2004 21:28:40 -0000 1.17
+++ AbstractHashedMap.java 26 May 2004 21:56:05 -0000 1.18
@@ -28,9 +28,10 @@
import java.util.Set;
import org.apache.commons.collections.IterableMap;
-import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.KeyValue;
import org.apache.commons.collections.MapIterator;
+import org.apache.commons.collections.iterators.EmptyIterator;
+import org.apache.commons.collections.iterators.EmptyMapIterator;
/**
* An abstract implementation of a hash-based map which provides numerous points for
@@ -713,7 +714,7 @@
*/
public MapIterator mapIterator() {
if (size == 0) {
- return IteratorUtils.EMPTY_MAP_ITERATOR;
+ return EmptyMapIterator.INSTANCE;
}
return new HashMapIterator(this);
}
@@ -779,7 +780,7 @@
*/
protected Iterator createEntrySetIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new EntrySetIterator(this);
}
@@ -868,7 +869,7 @@
*/
protected Iterator createKeySetIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new KeySetIterator(this);
}
@@ -945,7 +946,7 @@
*/
protected Iterator createValuesIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new ValuesIterator(this);
}
1.12 +8 -7
jakarta-commons/collections/src/java/org/apache/commons/collections/map/AbstractLinkedMap.java
Index: AbstractLinkedMap.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/AbstractLinkedMap.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- AbstractLinkedMap.java 9 Apr 2004 22:52:48 -0000 1.11
+++ AbstractLinkedMap.java 26 May 2004 21:56:05 -0000 1.12
@@ -20,12 +20,13 @@
import java.util.Map;
import java.util.NoSuchElementException;
-import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.MapIterator;
import org.apache.commons.collections.OrderedIterator;
import org.apache.commons.collections.OrderedMap;
import org.apache.commons.collections.OrderedMapIterator;
import org.apache.commons.collections.ResettableIterator;
+import org.apache.commons.collections.iterators.EmptyOrderedIterator;
+import org.apache.commons.collections.iterators.EmptyOrderedMapIterator;
/**
* An abstract implementation of a hash-based map that links entries to create an
@@ -331,7 +332,7 @@
*/
public MapIterator mapIterator() {
if (size == 0) {
- return IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR;
+ return EmptyOrderedMapIterator.INSTANCE;
}
return new LinkMapIterator(this);
}
@@ -348,7 +349,7 @@
*/
public OrderedMapIterator orderedMapIterator() {
if (size == 0) {
- return IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR;
+ return EmptyOrderedMapIterator.INSTANCE;
}
return new LinkMapIterator(this);
}
@@ -404,7 +405,7 @@
*/
protected Iterator createEntrySetIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ORDERED_ITERATOR;
+ return EmptyOrderedIterator.INSTANCE;
}
return new EntrySetIterator(this);
}
@@ -436,7 +437,7 @@
*/
protected Iterator createKeySetIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ORDERED_ITERATOR;
+ return EmptyOrderedIterator.INSTANCE;
}
return new KeySetIterator(this);
}
@@ -468,7 +469,7 @@
*/
protected Iterator createValuesIterator() {
if (size() == 0) {
- return IteratorUtils.EMPTY_ORDERED_ITERATOR;
+ return EmptyOrderedIterator.INSTANCE;
}
return new ValuesIterator(this);
}
1.18 +7 -6
jakarta-commons/collections/src/java/org/apache/commons/collections/map/Flat3Map.java
Index: Flat3Map.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/Flat3Map.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Flat3Map.java 3 May 2004 22:57:40 -0000 1.17
+++ Flat3Map.java 26 May 2004 21:56:05 -0000 1.18
@@ -28,9 +28,10 @@
import java.util.Set;
import org.apache.commons.collections.IterableMap;
-import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.MapIterator;
import org.apache.commons.collections.ResettableIterator;
+import org.apache.commons.collections.iterators.EmptyIterator;
+import org.apache.commons.collections.iterators.EmptyMapIterator;
/**
* A <code>Map</code> implementation that stores data in simple fields until
@@ -566,7 +567,7 @@
return delegateMap.mapIterator();
}
if (size == 0) {
- return IteratorUtils.EMPTY_MAP_ITERATOR;
+ return EmptyMapIterator.INSTANCE;
}
return new FlatMapIterator(this);
}
@@ -717,7 +718,7 @@
return parent.delegateMap.entrySet().iterator();
}
if (parent.size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new EntrySetIterator(parent);
}
@@ -885,7 +886,7 @@
return parent.delegateMap.keySet().iterator();
}
if (parent.size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new KeySetIterator(parent);
}
@@ -948,7 +949,7 @@
return parent.delegateMap.values().iterator();
}
if (parent.size() == 0) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return new ValuesIterator(parent);
}
1.19 +4 -2
jakarta-commons/collections/src/java/org/apache/commons/collections/MultiHashMap.java
Index: MultiHashMap.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/MultiHashMap.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- MultiHashMap.java 14 May 2004 22:33:31 -0000 1.18
+++ MultiHashMap.java 26 May 2004 21:56:05 -0000 1.19
@@ -26,6 +26,8 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import org.apache.commons.collections.iterators.EmptyIterator;
+
/**
* <code>MultiHashMap</code> is the default implementation of the
* [EMAIL PROTECTED] org.apache.commons.collections.MultiMap MultiMap} interface.
@@ -199,7 +201,7 @@
public Iterator iterator(Object key) {
Collection coll = getCollection(key);
if (coll == null) {
- return IteratorUtils.EMPTY_ITERATOR;
+ return EmptyIterator.INSTANCE;
}
return coll.iterator();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]