//----------------------------------------------------------------------- /** * 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 java.lang.IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new java.lang.IllegalArgumentException("Map must be empty"); } return(new MultiKeyMap(map)); }
/** * Is the key equal to the combined key. * * @param entry the entry to compare to * @param key1 the first key * @param key2 the second key * @param key3 the third key * @param key4 the fourth key * @return true if the key matches */ protected bool isEqualKey(AbstractHashedMap.HashEntry entry, Object key1, Object key2, Object key3, Object key4) { MultiKey multi = (MultiKey)entry.getKey(); return multi.size() == 4 && (key1 == null ? multi.getKey(0) == null : key1.equals(multi.getKey(0))) && (key2 == null ? multi.getKey(1) == null : key2.equals(multi.getKey(1))) && (key3 == null ? multi.getKey(2) == null : key3.equals(multi.getKey(2))) && (key4 == null ? multi.getKey(3) == null : key4.equals(multi.getKey(3))); }
//----------------------------------------------------------------------- /** * Constructs a new MultiKeyMap that decorates a <code>HashedMap</code>. */ public MultiKeyMap() : base() { map = new HashedMap(); }
//----------------------------------------------------------------------- /** * 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 java.lang.IllegalArgumentException("Map must not be null"); } if (map.size() > 0) { throw new java.lang.IllegalArgumentException("Map must be empty"); } return new MultiKeyMap(map); }
/** * Constructor that decorates the specified map and is called from * {@link #decorate(AbstractHashedMap)}. * The map must not be null and should be empty or only contain valid keys. * This constructor performs no validation. * * @param map the map to decorate */ protected MultiKeyMap(AbstractHashedMap map) : base() { this.map = map; }
/** * Constructor that decorates the specified map and is called from * {@link #decorate(AbstractHashedMap)}. * The map must not be null and should be empty or only contain valid keys. * This constructor performs no validation. * * @param map the map to decorate */ protected MultiKeyMap(AbstractHashedMap map) : base() { this.map = map; }
//----------------------------------------------------------------------- /** * Constructs a new MultiKeyMap that decorates a <code>HashedMap</code>. */ public MultiKeyMap() : base() { map = new HashedMap(); }
protected internal ReferenceValues(AbstractHashedMap parent) : base(parent) { }
protected internal ReferenceKeySet(AbstractHashedMap parent) : base(parent) { }
internal ReferenceEntrySet(AbstractHashedMap parent) : base(parent) { }