001 /*******************************************************************************
002 * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
003 * Thomschke.
004 *
005 * All Rights Reserved. This program and the accompanying materials
006 * are made available under the terms of the Eclipse Public License v1.0
007 * which accompanies this distribution, and is available at
008 * http://www.eclipse.org/legal/epl-v10.html
009 *
010 * Contributors:
011 * Sebastian Thomschke - initial implementation.
012 *******************************************************************************/
013 package net.sf.oval.collection;
014
015 import java.util.List;
016 import java.util.Map;
017 import java.util.Set;
018
019 import javolution.util.FastMap;
020 import javolution.util.FastSet;
021 import javolution.util.FastTable;
022
023 /**
024 * @author Sebastian Thomschke
025 */
026 public class CollectionFactoryJavalutionImpl implements CollectionFactory
027 {
028 /**
029 * {@inheritDoc}
030 */
031 public <ItemType> List<ItemType> createList()
032 {
033 return new FastTable<ItemType>();
034 }
035
036 /**
037 * {@inheritDoc}
038 */
039 public <ItemType> List<ItemType> createList(final int initialCapacity)
040 {
041 return new FastTable<ItemType>(initialCapacity);
042 }
043
044 /**
045 * {@inheritDoc}
046 */
047 public <KeyType, ValueType> Map<KeyType, ValueType> createMap()
048 {
049 return new FastMap<KeyType, ValueType>();
050 }
051
052 /**
053 * {@inheritDoc}
054 */
055 public <KeyType, ValueType> Map<KeyType, ValueType> createMap(final int initialCapacity)
056 {
057 return new FastMap<KeyType, ValueType>(initialCapacity);
058 }
059
060 /**
061 * {@inheritDoc}
062 */
063 public <ItemType> Set<ItemType> createSet()
064 {
065 return new FastSet<ItemType>();
066 }
067
068 /**
069 * {@inheritDoc}
070 */
071 public <ItemType> Set<ItemType> createSet(final int initialCapacity)
072 {
073 return new FastSet<ItemType>(initialCapacity);
074 }
075 }