public class TreeMapFactory extends AbstractSortedMapFactory
SortedMapFactory
interface that creates
instances of TreeMap
.Modifier and Type | Field and Description |
---|---|
static SortedMapFactory |
INSTANCE
The singleton instance.
|
Constructor and Description |
---|
TreeMapFactory() |
Modifier and Type | Method and Description |
---|---|
<K,V> SortedMap<K,V> |
create()
This method creates a new
Map instance. |
<K,V> SortedMap<K,V> |
create(int capacity)
This method creates a new
Map instance with the given capacity . |
Class<TreeMap> |
getMapImplementation()
This method gets the implementation of the
map-interface used by this factory. |
createGeneric, createGeneric, getMapInterface
public static final SortedMapFactory INSTANCE
public Class<TreeMap> getMapImplementation()
MapFactory
map-interface
used by this factory.Map
implementation.public <K,V> SortedMap<K,V> create()
MapFactory
Map
instance. Map
can NOT be bound to the generic type <MAP> because of limitations in Java's generic type
system. You need to work on the actual sub-interface (e.g. SortedMapFactory
) to get a more specific result
type.K
- the type of keys maintained by the map.V
- the type of mapped values.public <K,V> SortedMap<K,V> create(int capacity)
MapFactory
Map
instance with the given capacity
. For a regular map this will be the
initial capacity while a cache may never grow beyond this capacity limit and if reached force out entries last
recently of frequently used.K
- the type of keys maintained by the map.V
- the type of mapped values.capacity
- is the capacity of the map to create.Copyright © 2001–2016 mmm-Team. All rights reserved.