org.jrdf.set
Class MemSortedSetFactory

java.lang.Object
  extended by org.jrdf.set.MemSortedSetFactory
All Implemented Interfaces:
SortedSetFactory

public class MemSortedSetFactory
extends Object
implements SortedSetFactory

An in memory implementation that uses TreeSets and a small number of known types: Triples and PredicateNodes.


Constructor Summary
MemSortedSetFactory()
           
 
Method Summary
 void close()
          Close any resources used by the factory - possibly database connections, file handles and the like.
<T> SortedSet<T>
createSet(Class<T> clazz)
          Creates a sorted set for known type.
<T> SortedSet<T>
createSet(Class<T> clazz, Comparator<?> comparator)
          Creates a sorted set for a known type with a given comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemSortedSetFactory

public MemSortedSetFactory()
Method Detail

createSet

public <T> SortedSet<T> createSet(Class<T> clazz)
Description copied from interface: SortedSetFactory
Creates a sorted set for known type. The supported types depend on the implementation - current implementations support types such as Triple and PredicateNode. Otherwise, it will produce a sorted set without a comparator - which will need to be added later.

Specified by:
createSet in interface SortedSetFactory
Parameters:
clazz - The type of set to create.
Returns:
A sorted set.

createSet

public <T> SortedSet<T> createSet(Class<T> clazz,
                                  Comparator<?> comparator)
Description copied from interface: SortedSetFactory
Creates a sorted set for a known type with a given comparator. This allows non-supported types to be added. This is optional and may not be supported by all implementations.

Specified by:
createSet in interface SortedSetFactory
Parameters:
clazz - The type of set to create.
comparator - The comparator to use to determine the sort order.
Returns:
A sorted set.

close

public void close()
Description copied from interface: SortedSetFactory
Close any resources used by the factory - possibly database connections, file handles and the like. It is expected that a factory used that is not close may cause resource leaks.

Specified by:
close in interface SortedSetFactory