Rename AMap to IterableMap

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131391 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2003-12-02 23:51:50 +00:00
parent 4f0d77bc33
commit 2e14c5efe8
13 changed files with 60 additions and 60 deletions

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BidiMap.java,v 1.9 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BidiMap.java,v 1.10 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -70,11 +70,11 @@ package org.apache.commons.collections;
* a key to be looked up from a value with equal performance.
*
* @since Commons Collections 3.0
* @version $Revision: 1.9 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.10 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public interface BidiMap extends AMap {
public interface BidiMap extends IterableMap {
/**
* Obtains a <code>MapIterator</code> over the map.

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/AMap.java,v 1.2 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/IterableMap.java,v 1.1 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -65,7 +65,7 @@ import java.util.Map;
* A map iterator is an efficient way of iterating over maps.
* There is no need to access the entry set or cast to Map Entry objects.
* <pre>
* AMap map = new HashedMap();
* IterableMap map = new HashedMap();
* MapIterator it = map.mapIterator();
* while (it.hasNext()) {
* Object key = it.next();
@ -75,11 +75,11 @@ import java.util.Map;
* </pre>
*
* @since Commons Collections 3.0
* @version $Revision: 1.2 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.1 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public interface AMap extends Map {
public interface IterableMap extends Map {
/**
* Obtains a <code>MapIterator</code> over the map.
@ -87,7 +87,7 @@ public interface AMap extends Map {
* A map iterator is an efficient way of iterating over maps.
* There is no need to access the entry set or cast to Map Entry objects.
* <pre>
* AMap map = new HashedMap();
* IterableMap map = new HashedMap();
* MapIterator it = map.mapIterator();
* while (it.hasNext()) {
* Object key = it.next();

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapIterator.java,v 1.3 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapIterator.java,v 1.4 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -62,9 +62,9 @@ import java.util.Iterator;
/**
* Defines an iterator that operates over a <code>Map</code>.
* <p>
* This iterator is a special version designed for maps. It is much more
* This iterator is a special version designed for maps. It can be more
* efficient to use this rather than an entry set iterator where the option
* is available.
* is available, and it is certainly more convenient.
* <p>
* A map that provides this interface may not hold the data internally using
* Map Entry objects, thus this interface can avoid lots of object creation.
@ -82,7 +82,7 @@ import java.util.Iterator;
* </pre>
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.4 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/OrderedMap.java,v 1.2 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/OrderedMap.java,v 1.3 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -62,11 +62,11 @@ package org.apache.commons.collections;
* iteration through that order.
*
* @since Commons Collections 3.0
* @version $Revision: 1.2 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.3 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public interface OrderedMap extends AMap {
public interface OrderedMap extends IterableMap {
/**
* Obtains an <code>OrderedMapIterator</code> over the map.

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/Flat3Map.java,v 1.4 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/Flat3Map.java,v 1.5 2003/12/02 23:51:50 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -66,7 +66,7 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.commons.collections.AMap;
import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.MapIterator;
import org.apache.commons.collections.ResettableIterator;
@ -100,11 +100,11 @@ import org.apache.commons.collections.iterators.EntrySetMapIterator;
* Do not use <code>Flat3Map</code> if the size is likely to grow beyond 3.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.5 $ $Date: 2003/12/02 23:51:50 $
*
* @author Stephen Colebourne
*/
public class Flat3Map implements AMap {
public class Flat3Map implements IterableMap {
/** The size of the map, used while in flat mode */
private int iSize;

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/HashedMap.java,v 1.3 2003/12/02 00:37:11 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/HashedMap.java,v 1.4 2003/12/02 23:51:50 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -70,7 +70,7 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import org.apache.commons.collections.AMap;
import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.MapIterator;
@ -86,12 +86,12 @@ import org.apache.commons.collections.MapIterator;
* methods exposed.
*
* @since Commons Collections 3.0
* @version $Revision: 1.3 $ $Date: 2003/12/02 00:37:11 $
* @version $Revision: 1.4 $ $Date: 2003/12/02 23:51:50 $
*
* @author java util HashMap
* @author Stephen Colebourne
*/
public class HashedMap implements AMap, Serializable, Cloneable {
public class HashedMap implements IterableMap, Serializable, Cloneable {
/** Serialisation version */
static final long serialVersionUID = -1593250834999590599L;

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/UnmodifiableMap.java,v 1.4 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/UnmodifiableMap.java,v 1.5 2003/12/02 23:51:50 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -63,7 +63,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections.AMap;
import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.MapIterator;
import org.apache.commons.collections.Unmodifiable;
import org.apache.commons.collections.collection.UnmodifiableCollection;
@ -77,11 +77,11 @@ import org.apache.commons.collections.set.UnmodifiableSet;
* Decorates another <code>Map</code> to ensure it can't be altered.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.5 $ $Date: 2003/12/02 23:51:50 $
*
* @author Stephen Colebourne
*/
public final class UnmodifiableMap extends AbstractMapDecorator implements AMap, Unmodifiable {
public final class UnmodifiableMap extends AbstractMapDecorator implements IterableMap, Unmodifiable {
/**
* Factory method to create an unmodifiable map.
@ -125,8 +125,8 @@ public final class UnmodifiableMap extends AbstractMapDecorator implements AMap,
}
public MapIterator mapIterator() {
if (map instanceof AMap) {
MapIterator it = ((AMap) map).mapIterator();
if (map instanceof IterableMap) {
MapIterator it = ((IterableMap) map).mapIterator();
return UnmodifiableMapIterator.decorate(it);
} else {
MapIterator it = new EntrySetMapIterator(map);

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/Attic/AbstractTestAMap.java,v 1.2 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestIterableMap.java,v 1.1 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -61,26 +61,26 @@ import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.collections.AMap;
import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.BulkTest;
import org.apache.commons.collections.MapIterator;
import org.apache.commons.collections.iterators.AbstractTestMapIterator;
/**
* Abstract test class for {@link AMap} methods and contracts.
* Abstract test class for {@link IterableMap} methods and contracts.
*
* @version $Revision: 1.2 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.1 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public abstract class AbstractTestAMap extends AbstractTestMap {
public abstract class AbstractTestIterableMap extends AbstractTestMap {
/**
* JUnit constructor.
*
* @param testName the test name
*/
public AbstractTestAMap(String testName) {
public AbstractTestIterableMap(String testName) {
super(testName);
}
@ -159,40 +159,40 @@ public abstract class AbstractTestAMap extends AbstractTestMap {
}
public Object[] addSetValues() {
return AbstractTestAMap.this.getNewSampleValues();
return AbstractTestIterableMap.this.getNewSampleValues();
}
public boolean supportsRemove() {
return AbstractTestAMap.this.isRemoveSupported();
return AbstractTestIterableMap.this.isRemoveSupported();
}
public boolean supportsSetValue() {
return AbstractTestAMap.this.isSetValueSupported();
return AbstractTestIterableMap.this.isSetValueSupported();
}
public MapIterator makeEmptyMapIterator() {
resetEmpty();
return ((AMap) AbstractTestAMap.this.map).mapIterator();
return ((IterableMap) AbstractTestIterableMap.this.map).mapIterator();
}
public MapIterator makeFullMapIterator() {
resetFull();
return ((AMap) AbstractTestAMap.this.map).mapIterator();
return ((IterableMap) AbstractTestIterableMap.this.map).mapIterator();
}
public Map getMap() {
// assumes makeFullMapIterator() called first
return AbstractTestAMap.this.map;
return AbstractTestIterableMap.this.map;
}
public Map getConfirmedMap() {
// assumes makeFullMapIterator() called first
return AbstractTestAMap.this.confirmed;
return AbstractTestIterableMap.this.confirmed;
}
public void verify() {
super.verify();
AbstractTestAMap.this.verify();
AbstractTestIterableMap.this.verify();
}
}

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestOrderedMap.java,v 1.3 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestOrderedMap.java,v 1.4 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -75,11 +75,11 @@ import org.apache.commons.collections.iterators.AbstractTestOrderedMapIterator;
/**
* Abstract test class for {@link OrderedMap} methods and contracts.
*
* @version $Revision: 1.3 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.4 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public abstract class AbstractTestOrderedMap extends AbstractTestAMap {
public abstract class AbstractTestOrderedMap extends AbstractTestIterableMap {
/**
* JUnit constructor.

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFlat3Map.java,v 1.3 2003/12/01 22:48:59 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFlat3Map.java,v 1.4 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -69,11 +69,11 @@ import org.apache.commons.collections.iterators.AbstractTestMapIterator;
/**
* JUnit tests.
*
* @version $Revision: 1.3 $ $Date: 2003/12/01 22:48:59 $
* @version $Revision: 1.4 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public class TestFlat3Map extends AbstractTestAMap {
public class TestFlat3Map extends AbstractTestIterableMap {
public TestFlat3Map(String testName) {
super(testName);

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestHashedMap.java,v 1.1 2003/12/01 22:34:54 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestHashedMap.java,v 1.2 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -67,11 +67,11 @@ import org.apache.commons.collections.BulkTest;
/**
* JUnit tests.
*
* @version $Revision: 1.1 $ $Date: 2003/12/01 22:34:54 $
* @version $Revision: 1.2 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
public class TestHashedMap extends AbstractTestAMap {
public class TestHashedMap extends AbstractTestIterableMap {
public TestHashedMap(String testName) {
super(testName);

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestIdentityMap.java,v 1.1 2003/12/02 21:57:08 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestIdentityMap.java,v 1.2 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -64,13 +64,13 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
import org.apache.commons.collections.AMap;
import org.apache.commons.collections.IterableMap;
import org.apache.commons.collections.AbstractTestObject;
/**
* JUnit tests.
*
* @version $Revision: 1.1 $ $Date: 2003/12/02 21:57:08 $
* @version $Revision: 1.2 $ $Date: 2003/12/02 23:51:49 $
*
* @author Stephen Colebourne
*/
@ -104,7 +104,7 @@ public class TestIdentityMap extends AbstractTestObject {
//-----------------------------------------------------------------------
public void testBasics() {
AMap map = new IdentityMap();
IterableMap map = new IdentityMap();
assertEquals(0, map.size());
map.put(I1A, I2A);
@ -137,7 +137,7 @@ public class TestIdentityMap extends AbstractTestObject {
//-----------------------------------------------------------------------
public void testHashEntry() {
AMap map = new IdentityMap();
IterableMap map = new IdentityMap();
map.put(I1A, I2A);
map.put(I1B, I2A);

View File

@ -1,5 +1,5 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java,v 1.5 2003/12/01 22:34:54 scolebourne Exp $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java,v 1.6 2003/12/02 23:51:49 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@ -70,11 +70,11 @@ import org.apache.commons.collections.Unmodifiable;
* {@link UnmodifiableMap} implementation.
*
* @since Commons Collections 3.0
* @version $Revision: 1.5 $ $Date: 2003/12/01 22:34:54 $
* @version $Revision: 1.6 $ $Date: 2003/12/02 23:51:49 $
*
* @author Phil Steitz
*/
public class TestUnmodifiableMap extends AbstractTestAMap{
public class TestUnmodifiableMap extends AbstractTestIterableMap{
public TestUnmodifiableMap(String testName) {
super(testName);