org.castor.util
Class IdentityMap

java.lang.Object
  extended by org.castor.util.IdentityMap
All Implemented Interfaces:
java.util.Map

public final class IdentityMap
extends java.lang.Object
implements java.util.Map

An IdentityMap that uses reference-equality instead of object-equality. According to its special function it violates some design contracts of the Map interface.

Since:
0.9.9
Version:
$Revision: 1.3 $ $Date: 2005/07/24 20:37:15 $
Author:
Ralf Joachim

Nested Class Summary
 class IdentityMap.Entry
          An entry of the IdentityMap.
 
Constructor Summary
IdentityMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
          In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
 java.util.Set entrySet()
          In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
 java.lang.Object get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map map)
          This optional method has not been implemented for IdentityMap instead it throws a UnsupportedOperationException as defined in the Map interface.
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection values()
          In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

IdentityMap

public IdentityMap()
Method Detail

clear

public void clear()
Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

size

public int size()
Specified by:
size in interface java.util.Map
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
See Also:
Map.isEmpty()

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
See Also:
Map.put(java.lang.Object, java.lang.Object)

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
See Also:
Map.containsKey(java.lang.Object)

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
See Also:
Map.get(java.lang.Object)

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
See Also:
Map.remove(java.lang.Object)

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

entrySet

public java.util.Set entrySet()
In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.

Specified by:
entrySet in interface java.util.Map
See Also:
Map.entrySet()

values

public java.util.Collection values()
In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.

Specified by:
values in interface java.util.Map
See Also:
Map.values()

containsValue

public boolean containsValue(java.lang.Object value)
In contrast with the design contract of the Map interface this method has not been implemented and throws a UnsupportedOperationException.

Specified by:
containsValue in interface java.util.Map
See Also:
java.util.Map#containsValue()

putAll

public void putAll(java.util.Map map)
This optional method has not been implemented for IdentityMap instead it throws a UnsupportedOperationException as defined in the Map interface.

Specified by:
putAll in interface java.util.Map
See Also:
java.util.Map#putAll()


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com