planet.generic.commonapi.results
Class ResultsFactoryImpl

java.lang.Object
  extended byplanet.generic.commonapi.results.ResultsFactoryImpl
All Implemented Interfaces:
ResultsFactory, java.io.Serializable

public class ResultsFactoryImpl
extends java.lang.Object
implements ResultsFactory

Factory to build any specified results implementation classes.

Author:
Marc Sanchez, Jordi Pujol
See Also:
Serialized Form

Constructor Summary
ResultsFactoryImpl()
          Builds an uninitialized ResultsFactoryImpl.
 
Method Summary
 ResultsConstraint buildConstraint()
          Build the ResultsConstraint specified in the current configuration.
 ResultsEdge buildEdge(Id source, Id target, boolean directed, java.lang.String fill)
          Build a ResultsEdge with the specified values.
 ResultsGenerator buildGenerator()
          Builds the ResultsGenerator specified in the current configuration.
 ResultsFactory setValues(java.lang.Class resultsEdge, java.lang.Class resultsConstraint, java.lang.Class resultsGenerator)
          Sets the initial values for this ResultsFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultsFactoryImpl

public ResultsFactoryImpl()
Builds an uninitialized ResultsFactoryImpl. Requires the setValues(...) invokation.

Method Detail

setValues

public ResultsFactory setValues(java.lang.Class resultsEdge,
                                java.lang.Class resultsConstraint,
                                java.lang.Class resultsGenerator)
                         throws InitializationException
Sets the initial values for this ResultsFactory.

Specified by:
setValues in interface ResultsFactory
Parameters:
resultsEdge - Class reference of the current ResultsEdge implementation.
resultsConstraint - Class reference of the current ResultsConstraint implementation.
resultsGenerator - Class reference of the current ResultsGenerator implementation.
Returns:
The same instance once it has been updated.
Throws:
InitializationException - if some error occurs during the initialization process.
See Also:
ResultsFactory.setValues(java.lang.Class, java.lang.Class, java.lang.Class)

buildEdge

public ResultsEdge buildEdge(Id source,
                             Id target,
                             boolean directed,
                             java.lang.String fill)
                      throws InitializationException
Build a ResultsEdge with the specified values.

Specified by:
buildEdge in interface ResultsFactory
Parameters:
source - Source node Id.
target - Destination node Id.
directed - true when the edge is directed. false in other case.
fill - Fill color in "#RRGGBB" format.
Returns:
An instance of ResultsEdge.
Throws:
InitializationException - if an error occurs during the initialization.

buildGenerator

public ResultsGenerator buildGenerator()
                                throws InitializationException
Builds the ResultsGenerator specified in the current configuration.

Specified by:
buildGenerator in interface ResultsFactory
Returns:
The ResultsGenerator.
Throws:
InitializationException - if an error occurs during the initialization.

buildConstraint

public ResultsConstraint buildConstraint()
                                  throws InitializationException
Build the ResultsConstraint specified in the current configuration.

Specified by:
buildConstraint in interface ResultsFactory
Returns:
The ResultsConstraint.
Throws:
InitializationException - if an error occurs during the initialization.