/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
@Override public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) { TransformingIterator copy; try { copy = getClass().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } copy.setSource(getSource().deepCopy(env)); copy.scanning = scanning; copy.keyPos = keyPos; copy.keys.addAll(keys); copy.seekRange = (seekRange == null) ? null : new Range(seekRange); copy.seekColumnFamilies = (seekColumnFamilies == null) ? null : new HashSet<>(seekColumnFamilies); copy.seekColumnFamiliesInclusive = seekColumnFamiliesInclusive; copy.ve = ve; if (visibleCache != null) { copy.visibleCache = new LRUMap(visibleCache.maxSize()); copy.visibleCache.putAll(visibleCache); } if (parsedVisibilitiesCache != null) { copy.parsedVisibilitiesCache = new LRUMap(parsedVisibilitiesCache.maxSize()); copy.parsedVisibilitiesCache.putAll(parsedVisibilitiesCache); } copy.maxBufferSize = maxBufferSize; return copy; }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
/** * Constructor copying elements from another map. * <p/> * The maximum size is set from the map's size. * * @param map the map to copy * @param scanUntilRemovable scan until a removeable entry is found, default false * @throws NullPointerException if the map is null * @throws IllegalArgumentException if the map is empty * @since Commons Collections 3.1 */ public LRUMap(Map map, boolean scanUntilRemovable) { this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable); putAll(map); }
@Override public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) { TransformingIterator copy; try { copy = getClass().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } copy.setSource(getSource().deepCopy(env)); copy.scanning = scanning; copy.keyPos = keyPos; copy.keys.addAll(keys); copy.seekRange = (seekRange == null) ? null : new Range(seekRange); copy.seekColumnFamilies = (seekColumnFamilies == null) ? null : new HashSet<>(seekColumnFamilies); copy.seekColumnFamiliesInclusive = seekColumnFamiliesInclusive; copy.ve = ve; if (visibleCache != null) { copy.visibleCache = new LRUMap(visibleCache.maxSize()); copy.visibleCache.putAll(visibleCache); } if (parsedVisibilitiesCache != null) { copy.parsedVisibilitiesCache = new LRUMap(parsedVisibilitiesCache.maxSize()); copy.parsedVisibilitiesCache.putAll(parsedVisibilitiesCache); } copy.maxBufferSize = maxBufferSize; return copy; }