nenok
Class LCFactory

java.lang.Object
  extended by nenok.LCFactory

public final class LCFactory
extends Object

FACTORY class to build jointrees. Various methods to build join trees with different parameter lists are offered by this class. Basically, its main purposes is to simplify the user's life by preventing him from the details of using default values as parameters.

Version:
1.2
Author:
Marc Pouly

Constructor Summary
LCFactory()
          Constructor:
LCFactory(Architecture architecture)
          Constructor: Constructs jointrees of the given architecture class with an OSLA_SC construction algorithm.
 
Method Summary
 JoinTree create(File file, KB_Parser parser, Processor proc)
          Create method of this FACTORY class.
 JoinTree create(Knowledgebase kb)
          Create method of this FACTORY class.
 JoinTree create(Knowledgebase kb, Collection<Domain> queries, Processor proc)
          Create method of this FACTORY class.
 JoinTree create(Knowledgebase kb, Domain[] queries, Processor proc)
          Create method of this FACTORY class.
 JoinTree rebuild(File file, JT_Parser parser, Processor proc)
          Deserializes a jointree from a file by use of the given parser instance.
 void setArchitecture(Architecture architecture)
          Method to change the current factory's local computation architecture.
 void setConstructionAlgorithm(Algorithm algo)
          Method to change the current factory's jointree construction algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCFactory

public LCFactory()
Constructor:


LCFactory

public LCFactory(Architecture architecture)
Constructor: Constructs jointrees of the given architecture class with an OSLA_SC construction algorithm.

Parameters:
architecture - The architecture of local computation, i.e. the corresponding architecture's enum type.
Method Detail

create

public JoinTree create(Knowledgebase kb,
                       Collection<Domain> queries,
                       Processor proc)
                throws RemoteException,
                       ConstrException
Create method of this FACTORY class. Builds a jointree that corresponds to this factory's architecture from the given knowledgebase and query list. The factory's construction algorithm is used to build the tree.

Parameters:
kb - The knowledgebase from whom the jointree is build.
queries - A list of domains that are ensured to be covered by the resulting jointree.
proc - The processor that shall be assigned to query nodes.
Returns:
A jointree instance that corresponds to this factory's architecture.
Throws:
RemoteException - Exceptions caused by communication problems when the factory's processor is accessed.
ConstrException - Exceptions thrown by the jointree construction process.

create

public JoinTree create(Knowledgebase kb,
                       Domain[] queries,
                       Processor proc)
                throws RemoteException,
                       ConstrException
Create method of this FACTORY class. Builds a jointree that corresponds to this factory's architecture from the given knowledgebase and query list. The factory's construction algorithm is used to build the tree.

Parameters:
kb - The knowledgebase from whom the jointree is build.
queries - An array of domains that are ensured to be covered by the resulting jointree.
proc - The processor that shall be assigned to query nodes.
Returns:
A jointree instance that corresponds to this factory's architecture.
Throws:
RemoteException - Exceptions caused by communication problems when the factory's processor is accessed.
ConstrException - Exceptions thrown by the jointree construction process.

create

public JoinTree create(Knowledgebase kb)
                throws RemoteException,
                       ConstrException
Create method of this FACTORY class. Builds a jointree that corresponds to this factory's architecture from the given knowledgebase and query list. The factory's construction algorithm is used to build the tree. An arbitrary processor that occurs in the knowledgebase is assigned to query nodes.

Parameters:
kb - The knowledgebase from whom the jointree is build.
Returns:
A jointree instance that corresponds to this factory's architecture.
Throws:
RemoteException - Exceptions caused by communication problems when the factory's processor is accessed.
ConstrException - Exceptions thrown by the jointree construction process.

create

public JoinTree create(File file,
                       KB_Parser parser,
                       Processor proc)
                throws RemoteException,
                       ConstrException,
                       ParserException
Create method of this FACTORY class. Builds a jointree that corresponds to this factory's architecture from the parsed file content. The parsed Valuation objects will be stored on the processor given as argument. The factory's construction algorithm is used to build the tree.

Parameters:
file - The file to parse.
parser - The user defined parser instance.
proc - The processor that shall be assigned to query nodes.
Returns:
A jointree instance that corresponds to this factory's architecture.
Throws:
RemoteException - Exceptions caused by communication problems when the factory's processor is accessed.
ConstrException - Exceptions thrown by the jointree construction process.
ParserException - Exceptions caused by the parsing process.

rebuild

public JoinTree rebuild(File file,
                        JT_Parser parser,
                        Processor proc)
                 throws RemoteException,
                        ConstrException
Deserializes a jointree from a file by use of the given parser instance.

Parameters:
file - The file containing a serialized jointree.
parser - The parser for the deserialization process.
proc - A processor instance to upload the parsed valuations.
Returns:
A jointree instance that corresponds to this factory's architecture.
Throws:
RemoteException - Exceptions caused by communication problems when the factory's processor is accessed.
ConstrException - Exceptions thrown by the jointree construction process.

setArchitecture

public void setArchitecture(Architecture architecture)
Method to change the current factory's local computation architecture.

Parameters:
architecture - The new local computation architecture.

setConstructionAlgorithm

public void setConstructionAlgorithm(Algorithm algo)
Method to change the current factory's jointree construction algorithm.

Parameters:
algo - The new jointree construction algorithm.