e.g. Calendar Search Help
You must enter a value before pressing Search
axis

Class: org.apache.axis.utils.IdentityHashMap   ©

 OK to copy?
001 /**
002  * Created by IntelliJ IDEA.
003  * User: srida01
004  * Date: Dec 2, 2002
005  * Time: 10:38:46 AM
006  * To change this template use Options | File Templates.
007  */
008 package org.apache.axis.utils;
009 
010 import java.util.HashMap;
011 import java.util.Map;
012 
013 /**
014  * IdentityHashMap similar to JDK1.4's java.util.IdentityHashMap
015  * @author Davanum Srinivas <dims@yahoo.com>
016  */
017 public class IdentityHashMap extends HashMap
018 {
019     /**
020      * Constructor for IdentityHashMap.
021      * @param initialCapacity
022      * @param loadFactor
023      */
024     public IdentityHashMap(int initialCapacity, float loadFactor)
025     {
026         super(initialCapacity, loadFactor);
027     }
028 
029     /**
030      * Constructor for IdentityHashMap.
031      * @param initialCapacity
032      */
033     public IdentityHashMap(int initialCapacity)
034     {
035         super(initialCapacity);
036     }
037 
038     /**
039      * Constructor for IdentityHashMap.
040      */
041     public IdentityHashMap()
042     {
043         super();
044     }
045 
046     /**
047      * Constructor for IdentityHashMap.
048      * @param t
049      */
050     public IdentityHashMap(Map t)
051     {
052         super(t);
053     }
054 
055     /**
056      * @see Map#get(Object)
057      */
058     public Object get(Object key)
059     {
060         return super.get(new IDKey(key));
061     }
062 
063     /**
064      * @see Map#put(Object, Object)
065      */
066     public Object put(Object key, Object value)
067     {
068         return super.put(new IDKey(key), value);
069     }
070 
071     /**
072      * adds an object to the Map. new Identity(obj) is used as key
073      */
074     public Object add(Object value)
075     {
076         Object key = new IDKey(value);
Rate077         if (! super.containsKey(key))
078         {
079             return super.put(key, value);
080         }
081         else return null;
082 
083     }
084 
085     /**
086      * @see Map#remove(Object)
087      */
088     public Object remove(Object key)
089     {
090         return super.remove(new IDKey(key));
091     }
092 
093     /**
094      * @see Map#containsKey(Object)
095      */
096     public boolean containsKey(Object key)
097     {
Rate098         return super.containsKey(new IDKey(key));
099     }
100 }

            
All Examples in File:
Example
Line
Rating (found
useful by...)
77 0% of 0
98 0% of 0