net.sf.mmm.util.collection.base
Class ConcurrentLinkedQueueFactory

java.lang.Object
  extended by net.sf.mmm.util.collection.base.AbstractQueueFactory
      extended by net.sf.mmm.util.collection.base.ConcurrentLinkedQueueFactory
All Implemented Interfaces:
CollectionFactory<Queue>, QueueFactory

public class ConcurrentLinkedQueueFactory
extends AbstractQueueFactory

This is an implementation of the QueueFactory interface that creates instances of ConcurrentLinkedQueue.

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
static QueueFactory INSTANCE
          The singleton instance.
 
Constructor Summary
ConcurrentLinkedQueueFactory()
           
 
Method Summary
<E> Queue<E>
create()
          This method creates a new Collection instance.
<E> Queue<E>
create(int capacity)
          This method creates a new Collection instance with the given initial capacity.
 Class<ConcurrentLinkedQueue> getCollectionImplementation()
          This method gets the implementation of the collection-interface used by this factory.
 
Methods inherited from class net.sf.mmm.util.collection.base.AbstractQueueFactory
createGeneric, createGeneric, getCollectionInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final QueueFactory INSTANCE
The singleton instance.

Constructor Detail

ConcurrentLinkedQueueFactory

public ConcurrentLinkedQueueFactory()
Method Detail

getCollectionImplementation

public Class<ConcurrentLinkedQueue> getCollectionImplementation()
This method gets the implementation of the collection-interface used by this factory.

Returns:
the Collection implementation.

create

public <E> Queue<E> create()
This method creates a new Collection instance.
It is explicitly typed and respects the generic element type of the collection. Therefore the type of the Collection can NOT be bound to the generic type <COLLECTION> because of limitations in Java's generic type system. You need to work on the actual sub-interface (e.g. ListFactory) to get the proper result type.

Type Parameters:
E - the type of elements contained in the collection.
Returns:
the new collection instance.
See Also:
CollectionFactory.createGeneric()

create

public <E> Queue<E> create(int capacity)
This method creates a new Collection instance with the given initial capacity.
It is explicitly typed and respects the generic element type of the collection. Therefore the type of the Collection can NOT be bound to the generic type <COLLECTION> because of limitations in Java's generic type system. You need to work on the actual sub-interface (e.g. ListFactory) to get the proper result type.

Type Parameters:
E - the type of elements contained in the collection.
Parameters:
capacity - is the initial capacity of the collection.
Returns:
the new collection instance.
See Also:
CollectionFactory.createGeneric(int)


Copyright © 2001-2010 mmm-Team. All Rights Reserved.