/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
public Map makeEmptyMap() { return new MultiKeyMap(); }
/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param map the map to decorate, not null * @throws IllegalArgumentException if the map is null or not empty */ public static MultiKeyMap decorate(AbstractHashedMap map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap(map); }
/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param map the map to decorate, not null * @throws IllegalArgumentException if the map is null or not empty */ public static MultiKeyMap decorate(AbstractHashedMap map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap(map); }
public void testClone() { MultiKeyMap map = new MultiKeyMap(); map.put(new MultiKey(I1, I2), "1-2"); Map cloned = (Map) map.clone(); assertEquals(map.size(), cloned.size()); assertSame(map.get(new MultiKey(I1, I2)), cloned.get(new MultiKey(I1, I2))); }
SecurityInspectorReport() { this.entries = new MultiKeyMap(); this.groups = new HashSet<>(); this.rows = new TreeSet<>(getRowComparator()); this.columns = new HashSet<>(); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Clones the map without cloning the keys or values. * * @return a shallow clone */ public Object clone() { return new MultiKeyMap((AbstractHashedMap) map.clone()); }
/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param map the map to decorate, not null * @throws IllegalArgumentException if the map is null or not empty */ public static MultiKeyMap decorate(AbstractHashedMap map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap(map); }
/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param map the map to decorate, not null * @throws IllegalArgumentException if the map is null or not empty */ public static MultiKeyMap decorate(AbstractHashedMap map) { if (map == null) { throw new IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap(map); }
MultiKeyMap map = new MultiKeyMap(); Integer counter = new Integer(1); map.put("String1","String2",counter); Integer value = (Integer)map.get("String1", "String2");
public static void main(String[] args) { MultiKeyMap multiKeyMap = new MultiKeyMap(); int[] array1 = new int[10]; int[] array2 = new int[10]; multiKeyMap.put(13,52,array1, "First"); multiKeyMap.put(81,22,array2, "Second"); System.out.println(multiKeyMap.get(81,22,array2)); }
MultiKeyMap keyMap = new MultiKeyMap();//MultiKeyMap Creation keyMap.put("1","2","OneTwo");//storing value OgnlContext context = new OgnlContext();// Ognl Context context.put("vap", keyMap); Object expression = Ognl.parseExpression("vap.get(\"1\",\"2\")");// Ognl expression //to retrive value from multikeyMap System.out.println(Ognl.getValue(expression, context));//Printing value.
MultiKeyMap multimap = new MultiKeyMap();
MultiKeyMap multiKeyMap = new MultiKeyMap(); multiKeyMap.put("Key 1A","Key 1B","Value 1"); multiKeyMap.put("Key 2A","Key 2B","Value 2"); multiKeyMap.put("Key 3A","Key 3B","Value 3"); MapIterator it = multiKeyMap.mapIterator(); while (it.hasNext()) { it.next(); MultiKey mk = (MultiKey) it.getKey(); // Option 1 System.out.println(mk.getKey(0)); System.out.println(mk.getKey(1)); // Option 2 for (Object subkey : mk.getKeys()) System.out.println(subkey); System.out.println(it.getValue()); }
MultiKeyMap multiKeyMap = new MultiKeyMap(); multiKeyMap.put("New York","IBM","Sam"); multiKeyMap.put("Sydney","Infosys","Honey"); multiKeyMap.put("Prague","JP Morgan","Peter"); multiKeyMap.put("Scotland","RBS","Deny"); multiKeyMap.put("Paris","Nomura","Lily"); multiKeyMap.put("Melbourne","Citi Bank","Sandy"); multiKeyMap.put("Aukland","Bank of America","Tommy");