org.apache.ignite.internal.util

## Class GridBoundedLinkedHashMap<K,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,V>
    - - java.util.LinkedHashMap<K,V>
      - - org.apache.ignite.internal.util.GridBoundedLinkedHashMap<K,V>

Type Parameters:
  `K` - Map key.
  `V` - Map entry.

All Implemented Interfaces:
  Serializable, Cloneable, Map<K,V>

    public class GridBoundedLinkedHashMap<K,V>
    extends LinkedHashMap<K,V>

Generic map with an upper bound. Once map reaches its maximum capacity, the eldest elements will be removed based on insertion order.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`GridBoundedLinkedHashMap(int maxCap)` Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified maximum capacity, and a default load factor (0.75).
`GridBoundedLinkedHashMap(int initCap, int maxCap)` Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, and a default load factor (0.75).
`GridBoundedLinkedHashMap(int initCap, int maxCap, float loadFactor)` Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, and load factor.
`GridBoundedLinkedHashMap(int initCap, int maxCap, float loadFactor, boolean accessOrder)` Constructs an empty `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, load factor and ordering mode.

### Method Summary

Methods
`Object` `clone()`
`protected boolean` `removeEldestEntry(Map.Entry<K,V> eldest)`

### Methods inherited from class java.util.LinkedHashMap

`clear, containsValue, get`

### Methods inherited from class java.util.HashMap

`containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

### Constructor Detail

#### GridBoundedLinkedHashMap

    public GridBoundedLinkedHashMap(int maxCap)
                             throws IllegalArgumentException

Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified maximum capacity, and a default load factor (0.75).

Parameters:
  `maxCap` - Maximum map capacity.
Throws:
  `IllegalArgumentException` - If the maximum capacity is negative.

#### GridBoundedLinkedHashMap

    public GridBoundedLinkedHashMap(int initCap,
                            int maxCap)
                             throws IllegalArgumentException

Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, and a default load factor (0.75).

Parameters:
  `initCap` - Initial map capacity.
  `maxCap` - Maximum map capacity.
Throws:
  `IllegalArgumentException` - If the initial capacity is negative, or maximum capacity is smaller than initial capacity.

#### GridBoundedLinkedHashMap

    public GridBoundedLinkedHashMap(int initCap,
                            int maxCap,
                            float loadFactor)
                             throws IllegalArgumentException

Constructs an empty insertion-ordered `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, and load factor.

Parameters:
  `initCap` - Initial map capacity.
  `maxCap` - Maximum map capacity.
  `loadFactor` - Load factor.
Throws:
  `IllegalArgumentException` - If the initial capacity is negative, the load factor is non-positive, or maximum capacity is smaller than initial capacity.

#### GridBoundedLinkedHashMap

    public GridBoundedLinkedHashMap(int initCap,
                            int maxCap,
                            float loadFactor,
                            boolean accessOrder)
                             throws IllegalArgumentException

Constructs an empty `GridBoundedLinkedHashMap` instance with the specified initial capacity, maximum capacity, load factor and ordering mode.

Parameters:
  `initCap` - Initial map capacity.
  `maxCap` - Maximum map capacity.
  `loadFactor` - Load factor.
  `accessOrder` - The ordering mode - `true` for access-order, `false` for insertion-order.
Throws:
  `IllegalArgumentException` - If the initial capacity is negative, the load factor is non-positive, or maximum capacity is smaller than initial capacity.

### Method Detail

#### removeEldestEntry

    protected boolean removeEldestEntry(Map.Entry<K,V> eldest)

Overrides:
  `removeEldestEntry` in class `LinkedHashMap<K,V>`

#### clone

    public Object clone()

Overrides:
  `clone` in class `HashMap<K,V>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016