View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2014 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.collection;
14  
15  import java.util.List;
16  import java.util.Map;
17  import java.util.Set;
18  
19  import javolution.util.FastMap;
20  import javolution.util.FastSet;
21  import javolution.util.FastTable;
22  
23  /**
24   * @author Sebastian Thomschke
25   */
26  public class CollectionFactoryJavolutionImpl implements CollectionFactory
27  {
28  	/**
29  	 * {@inheritDoc}
30  	 */
31  	public <ItemType> List<ItemType> createList()
32  	{
33  		return new FastTable<ItemType>();
34  	}
35  
36  	/**
37  	 * {@inheritDoc}
38  	 */
39  	public <ItemType> List<ItemType> createList(final int initialCapacity)
40  	{
41  		return new FastTable<ItemType>(initialCapacity);
42  	}
43  
44  	/**
45  	 * {@inheritDoc}
46  	 */
47  	public <KeyType, ValueType> Map<KeyType, ValueType> createMap()
48  	{
49  		return new FastMap<KeyType, ValueType>();
50  	}
51  
52  	/**
53  	 * {@inheritDoc}
54  	 */
55  	public <KeyType, ValueType> Map<KeyType, ValueType> createMap(final int initialCapacity)
56  	{
57  		return new FastMap<KeyType, ValueType>(initialCapacity);
58  	}
59  
60  	/**
61  	 * {@inheritDoc}
62  	 */
63  	public <ItemType> Set<ItemType> createSet()
64  	{
65  		return new FastSet<ItemType>();
66  	}
67  
68  	/**
69  	 * {@inheritDoc}
70  	 */
71  	public <ItemType> Set<ItemType> createSet(final int initialCapacity)
72  	{
73  		return new FastSet<ItemType>(initialCapacity);
74  	}
75  }