Ensure all MapEntry implementation are also KeyValue implementations
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131413 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5457ede14f
commit
5f8fc2f974
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/DefaultMapEntry.java,v 1.15 2003/12/05 20:23:57 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/DefaultMapEntry.java,v 1.16 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -62,17 +62,16 @@ import java.util.Map;
|
|||
/**
|
||||
* A default implementation of {@link java.util.Map.Entry}
|
||||
*
|
||||
* @deprecated Use the version in the keyvalue subpackage.
|
||||
* @since Commons Collections 1.0
|
||||
* @version $Revision: 1.15 $ $Date: 2003/12/05 20:23:57 $
|
||||
* @version $Revision: 1.16 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Michael A. Smith
|
||||
* @author Neil O'Toole
|
||||
* @author Stephen Colebourne
|
||||
*
|
||||
* @deprecated Use the version in the keyvalue subpackage.
|
||||
*/
|
||||
public class DefaultMapEntry implements Map.Entry {
|
||||
public class DefaultMapEntry implements Map.Entry, KeyValue {
|
||||
|
||||
/** The key */
|
||||
private Object key;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/DoubleOrderedMap.java,v 1.8 2003/11/29 18:05:39 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/DoubleOrderedMap.java,v 1.9 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -141,7 +141,7 @@ import java.util.Set;
|
|||
* @see DualTreeBidiMap
|
||||
* @see DualHashBidiMap
|
||||
* @since Commons Collections 2.0
|
||||
* @version $Revision: 1.8 $ $Date: 2003/11/29 18:05:39 $
|
||||
* @version $Revision: 1.9 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Marc Johnson
|
||||
*/
|
||||
|
@ -1794,7 +1794,7 @@ public final class DoubleOrderedMap extends AbstractMap {
|
|||
} // end private abstract class DoubleOrderedMapIterator
|
||||
|
||||
// final for performance
|
||||
private static final class Node implements Map.Entry {
|
||||
private static final class Node implements Map.Entry, KeyValue {
|
||||
|
||||
private Comparable[] data;
|
||||
private Node[] leftNode;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ReferenceMap.java,v 1.18 2003/12/05 20:23:57 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ReferenceMap.java,v 1.19 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -119,7 +119,7 @@ import org.apache.commons.collections.keyvalue.DefaultMapEntry;
|
|||
*
|
||||
* @deprecated Moved to map subpackage. Due to be removed in v4.0.
|
||||
* @since Commons Collections 2.1
|
||||
* @version $Revision: 1.18 $ $Date: 2003/12/05 20:23:57 $
|
||||
* @version $Revision: 1.19 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Paul Jack
|
||||
*/
|
||||
|
@ -758,7 +758,7 @@ public class ReferenceMap extends AbstractMap {
|
|||
|
||||
// If getKey() or getValue() returns null, it means
|
||||
// the mapping is stale and should be removed.
|
||||
private class Entry implements Map.Entry {
|
||||
private class Entry implements Map.Entry, KeyValue {
|
||||
|
||||
Object key;
|
||||
Object value;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v 1.22 2003/12/03 11:37:44 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/SequencedHashMap.java,v 1.23 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -91,7 +91,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
|||
*
|
||||
* @see org.apache.commons.collections.set.ListOrderedSet
|
||||
* @since Commons Collections 2.0
|
||||
* @version $Revision: 1.22 $ $Date: 2003/12/03 11:37:44 $
|
||||
* @version $Revision: 1.23 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Michael A. Smith
|
||||
* @author Daniel Rall
|
||||
|
@ -104,7 +104,7 @@ public class SequencedHashMap implements Map, Cloneable, Externalizable {
|
|||
* {@link java.util.Map.Entry} that doubles as a node in the linked list
|
||||
* of sequenced mappings.
|
||||
*/
|
||||
private static class Entry implements Map.Entry {
|
||||
private static class Entry implements Map.Entry, KeyValue {
|
||||
// Note: This class cannot easily be made clonable. While the actual
|
||||
// implementation of a clone would be simple, defining the semantics is
|
||||
// difficult. If a shallow clone is implemented, then entry.next.prev !=
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v 1.13 2003/12/03 15:16:49 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/StaticBucketMap.java,v 1.14 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -131,7 +131,7 @@ import java.util.Set;
|
|||
*
|
||||
* @deprecated Moved to map subpackage. Due to be removed in v4.0.
|
||||
* @since Commons Collections 2.1
|
||||
* @version $Revision: 1.13 $ $Date: 2003/12/03 15:16:49 $
|
||||
* @version $Revision: 1.14 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
|
||||
* @author <a href="mailto:g-froehlich@gmx.de">Gerhard Froehlich</a>
|
||||
|
@ -491,7 +491,7 @@ public final class StaticBucketMap implements Map {
|
|||
/**
|
||||
* The Map.Entry for the StaticBucketMap.
|
||||
*/
|
||||
private static final class Node implements Map.Entry
|
||||
private static final class Node implements Map.Entry, KeyValue
|
||||
{
|
||||
protected Object key;
|
||||
protected Object value;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java,v 1.5 2003/12/05 20:23:58 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java,v 1.6 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -67,6 +67,7 @@ import java.util.Set;
|
|||
|
||||
import org.apache.commons.collections.BidiMap;
|
||||
import org.apache.commons.collections.IteratorUtils;
|
||||
import org.apache.commons.collections.KeyValue;
|
||||
import org.apache.commons.collections.MapIterator;
|
||||
import org.apache.commons.collections.OrderedBidiMap;
|
||||
import org.apache.commons.collections.OrderedIterator;
|
||||
|
@ -107,7 +108,7 @@ import org.apache.commons.collections.keyvalue.UnmodifiableMapEntry;
|
|||
* UnsupportedOperationException on attempts to call that method.
|
||||
*
|
||||
* @since Commons Collections 3.0 (previously DoubleOrderedMap v2.0)
|
||||
* @version $Revision: 1.5 $ $Date: 2003/12/05 20:23:58 $
|
||||
* @version $Revision: 1.6 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Marc Johnson
|
||||
* @author Stephen Colebourne
|
||||
|
@ -1713,7 +1714,7 @@ public class TreeBidiMap implements OrderedBidiMap {
|
|||
/**
|
||||
* A node used to store the data.
|
||||
*/
|
||||
static class Node implements Map.Entry {
|
||||
static class Node implements Map.Entry, KeyValue {
|
||||
|
||||
private Comparable[] data;
|
||||
private Node[] leftNode;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/keyvalue/AbstractMapEntryDecorator.java,v 1.1 2003/12/05 20:23:56 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/keyvalue/AbstractMapEntryDecorator.java,v 1.2 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -59,16 +59,18 @@ package org.apache.commons.collections.keyvalue;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections.KeyValue;
|
||||
|
||||
/**
|
||||
* Provides a base decorator that allows additional functionality to be added
|
||||
* to a Map Entry.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.1 $ $Date: 2003/12/05 20:23:56 $
|
||||
* @version $Revision: 1.2 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractMapEntryDecorator implements Map.Entry {
|
||||
public abstract class AbstractMapEntryDecorator implements Map.Entry, KeyValue {
|
||||
|
||||
/** The <code>Map.Entry</code> to decorate */
|
||||
protected final Map.Entry entry;
|
||||
|
@ -81,7 +83,7 @@ public abstract class AbstractMapEntryDecorator implements Map.Entry {
|
|||
*/
|
||||
public AbstractMapEntryDecorator(Map.Entry entry) {
|
||||
if (entry == null) {
|
||||
throw new IllegalArgumentException("Map entry must not be null");
|
||||
throw new IllegalArgumentException("Map Entry must not be null");
|
||||
}
|
||||
this.entry = entry;
|
||||
}
|
||||
|
|
|
@ -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.5 2003/12/03 19:04:41 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.6 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -72,6 +72,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -86,7 +87,7 @@ import org.apache.commons.collections.MapIterator;
|
|||
* methods exposed.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2003/12/03 19:04:41 $
|
||||
* @version $Revision: 1.6 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author java util HashMap
|
||||
* @author Stephen Colebourne
|
||||
|
@ -853,7 +854,7 @@ public class HashedMap implements IterableMap, Serializable, Cloneable {
|
|||
/**
|
||||
* HashEntry
|
||||
*/
|
||||
protected static class HashEntry implements Map.Entry {
|
||||
protected static class HashEntry implements Map.Entry, KeyValue {
|
||||
protected HashEntry next;
|
||||
protected int hashCode;
|
||||
protected Object key;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/ReferenceMap.java,v 1.2 2003/12/05 20:23:57 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/ReferenceMap.java,v 1.3 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -76,6 +76,7 @@ import java.util.Map;
|
|||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.KeyValue;
|
||||
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
|
||||
|
||||
/**
|
||||
|
@ -118,7 +119,7 @@ import org.apache.commons.collections.keyvalue.DefaultMapEntry;
|
|||
* @see java.lang.ref.Reference
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.2 $ $Date: 2003/12/05 20:23:57 $
|
||||
* @version $Revision: 1.3 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Paul Jack
|
||||
*/
|
||||
|
@ -757,7 +758,7 @@ public class ReferenceMap extends AbstractMap {
|
|||
|
||||
// If getKey() or getValue() returns null, it means
|
||||
// the mapping is stale and should be removed.
|
||||
private class Entry implements Map.Entry {
|
||||
private class Entry implements Map.Entry, KeyValue {
|
||||
|
||||
Object key;
|
||||
Object value;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v 1.1 2003/12/03 15:16:49 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v 1.2 2003/12/06 13:03:15 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -66,6 +66,8 @@ import java.util.Map;
|
|||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.collections.KeyValue;
|
||||
|
||||
/**
|
||||
* A StaticBucketMap is an efficient, thread-safe implementation of
|
||||
* <code>java.util.Map</code> that performs well in in a highly
|
||||
|
@ -130,7 +132,7 @@ import java.util.Set;
|
|||
* operations will affect the map.<p>
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.1 $ $Date: 2003/12/03 15:16:49 $
|
||||
* @version $Revision: 1.2 $ $Date: 2003/12/06 13:03:15 $
|
||||
*
|
||||
* @author Berin Loritsch
|
||||
* @author Gerhard Froehlich
|
||||
|
@ -478,7 +480,7 @@ public final class StaticBucketMap implements Map {
|
|||
/**
|
||||
* The Map.Entry for the StaticBucketMap.
|
||||
*/
|
||||
private static final class Node implements Map.Entry {
|
||||
private static final class Node implements Map.Entry, KeyValue {
|
||||
protected Object key;
|
||||
protected Object value;
|
||||
protected Node next;
|
||||
|
|
Loading…
Reference in New Issue