1 16 package org.apache.commons.collections.map; 17 18 import java.io.IOException ; 19 import java.io.ObjectInputStream ; 20 import java.io.ObjectOutputStream ; 21 import java.io.Serializable ; 22 import java.util.Map ; 23 24 53 public class CaseInsensitiveMap extends AbstractHashedMap implements Serializable , Cloneable { 54 55 56 private static final long serialVersionUID = -7074655917369299456L; 57 58 61 public CaseInsensitiveMap() { 62 super(DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD); 63 } 64 65 71 public CaseInsensitiveMap(int initialCapacity) { 72 super(initialCapacity); 73 } 74 75 84 public CaseInsensitiveMap(int initialCapacity, float loadFactor) { 85 super(initialCapacity, loadFactor); 86 } 87 88 98 public CaseInsensitiveMap(Map map) { 99 super(map); 100 } 101 102 112 protected Object convertKey(Object key) { 113 if (key != null) { 114 return key.toString().toLowerCase(); 115 } else { 116 return AbstractHashedMap.NULL; 117 } 118 } 119 120 126 public Object clone() { 127 return super.clone(); 128 } 129 130 133 private void writeObject(ObjectOutputStream out) throws IOException { 134 out.defaultWriteObject(); 135 doWriteObject(out); 136 } 137 138 141 private void readObject(ObjectInputStream in) throws IOException , ClassNotFoundException { 142 in.defaultReadObject(); 143 doReadObject(in); 144 } 145 146 } 147 | Popular Tags |