nz.ac.waikato.mcennis.rat.graph.link
Class LinkFactory

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.AbstractFactory<Link>
      extended by nz.ac.waikato.mcennis.rat.graph.link.LinkFactory

public class LinkFactory
extends AbstractFactory<Link>

Class for generating Links from a Properties map.


Field Summary
static boolean isInitialized
           
 
Fields inherited from class nz.ac.waikato.mcennis.rat.AbstractFactory
map, properties
 
Constructor Summary
protected LinkFactory()
          Creates a new instance of LinkFactory
 
Method Summary
 Link create(Properties props)
          Create the given object using the settings in the Properties object.
 Link create(java.lang.String relation)
          Creates a new Link based on the 'LinkClass' attribute.
 Link create(java.lang.String relation, Properties parameters)
           
 Parameter getClassParameter()
          Return the parameter containing the name of the default type produced by this object.
static void initialization()
           
static LinkFactory newInstance()
          Create a new reference to a singelton LinkFactory object
 
Methods inherited from class nz.ac.waikato.mcennis.rat.AbstractFactory
addDefaultProperty, addType, check, check, getKnownTypes, getParameter, getParameter, setDefaultProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isInitialized

public static boolean isInitialized
Constructor Detail

LinkFactory

protected LinkFactory()
Creates a new instance of LinkFactory

Method Detail

newInstance

public static LinkFactory newInstance()
Create a new reference to a singelton LinkFactory object

Returns:
a reference to a LinkFactory

initialization

public static void initialization()

create

public Link create(java.lang.String relation)
Creates a new Link based on the 'LinkClass' attribute. Currently only BasicLink is supported, so this value is ignored. 'LinkType' sets the link type (relation) of this link before returning.

Parameters:
props - map of properties for creating a map
Returns:
a newly created Link

create

public Link create(Properties props)
Description copied from class: AbstractFactory
Create the given object using the settings in the Properties object. This function is the only global creation object, but each factory should also define a more user-friendly version consisting of a set of commonly used creation parameters as well as a version combining commonly used features with a Properties object. The property may be null. if the creation fails, the factory should log to the Logger the explanation and return null. If at all possible, the factory should provide a reasonable fail-over value rather than return null.

Specified by:
create in class AbstractFactory<Link>
Parameters:
props - parameters used to control the factory.
Returns:
newly created object or null

create

public Link create(java.lang.String relation,
                   Properties parameters)

getClassParameter

public Parameter getClassParameter()
Description copied from class: AbstractFactory
Return the parameter containing the name of the default type produced by this object. The parameter will have exactly one value of type String. The type name of this parameter is the type that controls which class of object is produced.

Specified by:
getClassParameter in class AbstractFactory<Link>
Returns:
parameter containing the default type.

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads