jpaul.DataStructs
Class RelationFactory<K,V>

java.lang.Object
  extended by jpaul.DataStructs.RelationFactory<K,V>
All Implemented Interfaces:
Factory<Relation<K,V>>
Direct Known Subclasses:
RelFacts.COWRelationFactory, RelFacts.MapSetRelationFactory

public abstract class RelationFactory<K,V>
extends java.lang.Object
implements Factory<Relation<K,V>>

RelationFactory is a relation-specific instance of the factory pattern.

Various relation factories are available in the class RelFacts.

Version:
$Id: RelationFactory.java,v 1.4 2005/08/22 14:07:21 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Constructor Summary
RelationFactory()
           
 
Method Summary
abstract  Relation<K,V> create()
          Create a new object of class T.
 Relation<K,V> create(Relation<K,V> r)
          Default implementation: uses create() to create an empty relation, and next add each pair from r to the new relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationFactory

public RelationFactory()
Method Detail

create

public abstract Relation<K,V> create()
Description copied from interface: Factory
Create a new object of class T. Corresponds to a default constructor.

Specified by:
create in interface Factory<Relation<K,V>>

create

public Relation<K,V> create(Relation<K,V> r)
Default implementation: uses create() to create an empty relation, and next add each pair from r to the new relation.

Specified by:
create in interface Factory<Relation<K,V>>


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu