fulmine.util.collection
Interface ICollectionBuilder

All Known Implementing Classes:
CollectionBuilder

public interface ICollectionBuilder

A builder for Collection instances. This is used as a plug-in for the CollectionFactory to provide different implementations.

Author:
Ramon Servadei

Method Summary
<T> List<T>
newList()
          Construct a List implementation with its implementation default size.
<T> List<T>
newList(Collection<T> other)
          Construct a List implementation from another Collection instance size.
<T> List<T>
newList(int size)
          Construct a List implementation with the given size.
<K,V> Map<K,V>
newMap()
          Construct a Map implementation with the implementation default size.
<K,V> Map<K,V>
newMap(int size)
          Construct a Map implementation with the given size.
<K,V> Map<K,V>
newMap(int size, float loadFactor)
          Construct a Map implementation with the given size and loadFactor.
<K,V> Map<K,V>
newMap(Map<K,V> other)
          Construct a Map implementation from another instance.
<T> Queue<T>
newQueue()
          Construct a Queue implementation with the implementation default size.
<T> Queue<T>
newQueue(int size)
          Construct a Queue implementation with the given size.
<T> Set<T>
newSet()
          Construct a Set implementation with the implementation default size.
<T> Set<T>
newSet(Collection<T> other)
          Construct a Set implementation from another Collection instance.
<T> Set<T>
newSet(int size)
          Construct a Set implementation with the given size.
 Map newUntypedMap(int size)
          Construct a Map implementation with the given size.
 Map newUntypedOrderedMap(int size)
          Construct a Map implementation with the given size.
 

Method Detail

newSet

<T> Set<T> newSet(int size)
Construct a Set implementation with the given size.

Type Parameters:
T - the type for the set elements
Parameters:
size - the size
Returns:
a Set implementation

newSet

<T> Set<T> newSet(Collection<T> other)
Construct a Set implementation from another Collection instance. This copies the contents of the other collection into the newly constructed implementation.

Type Parameters:
T - the type for the set elements
Parameters:
other - the other Collection instance to construct the Set from
Returns:
a Set implementation constructed from a Collection instance.

newSet

<T> Set<T> newSet()
Construct a Set implementation with the implementation default size.

Type Parameters:
T - the type for the set elements
Returns:
a Set implementation

newQueue

<T> Queue<T> newQueue()
Construct a Queue implementation with the implementation default size.

Type Parameters:
T - the type for the queue elements
Returns:
a Queue implementation

newQueue

<T> Queue<T> newQueue(int size)
Construct a Queue implementation with the given size.

Type Parameters:
T - the type for the queue elements
Parameters:
size - the size
Returns:
a Queue implementation

newList

<T> List<T> newList()
Construct a List implementation with its implementation default size.

Type Parameters:
T - the type for the list elements
Returns:
a List implementation

newList

<T> List<T> newList(Collection<T> other)
Construct a List implementation from another Collection instance size.

Type Parameters:
T - the type for the list elements
Parameters:
other - the other Collection to construct this list from
Returns:
a List implementation constructed with the elements of the other Collection

newList

<T> List<T> newList(int size)
Construct a List implementation with the given size.

Type Parameters:
T - the type for the list elements
Parameters:
size - the size
Returns:
a List implementation

newMap

<K,V> Map<K,V> newMap(int size)
Construct a Map implementation with the given size.

Type Parameters:
K - the type for the map keys
V - the type for the map values
Parameters:
size - the size
Returns:
a Map implementation

newUntypedOrderedMap

Map newUntypedOrderedMap(int size)
Construct a Map implementation with the given size. The implementation maintains insertion order and does not have any generic type information.

Parameters:
size - the size
Returns:
a Map implementation

newUntypedMap

Map newUntypedMap(int size)
Construct a Map implementation with the given size. This returns a map with no generic type information.

Parameters:
size - the size
Returns:
a Map implementation

newMap

<K,V> Map<K,V> newMap(int size,
                      float loadFactor)
Construct a Map implementation with the given size and loadFactor.

Type Parameters:
K - the type for the map keys
V - the type for the map values
Parameters:
size - the size
loadFactor - the loadFactor
Returns:
a Map implementation

newMap

<K,V> Map<K,V> newMap(Map<K,V> other)
Construct a Map implementation from another instance. This copies the contents of the other map into the newly constructed implementation.

Type Parameters:
K - the type for the map keys
V - the type for the map values
Parameters:
other - the other instance to construct this map from
Returns:
a Map implementation constructed from the other instance.

newMap

<K,V> Map<K,V> newMap()
Construct a Map implementation with the implementation default size.

Type Parameters:
K - the type for the map keys
V - the type for the map values
Returns:
a Map implementation


Copyright © 2007-2009. All Rights Reserved.