org.patterncoder.pattern
Class PatternClass

java.lang.Object
  extended by org.patterncoder.pattern.PatternClass

public class PatternClass
extends java.lang.Object

PatternClass is used to create a model object of a class which is to be implemented as part of design pattern.


Constructor Summary
PatternClass()
          Creates a new instance of PatternClass
PatternClass(java.lang.String id, java.lang.String compType, java.lang.String template, java.lang.String description, java.lang.String name)
          Creates a new instance of PatternClass
 
Method Summary
 void addDependancy(java.lang.String depId)
          The PatternClass object maintains a List of other components within the pattern that it must know about during its implementation.
 java.lang.String getCompType()
          Returns the component type.
 java.util.List<java.lang.String> getDependants()
          Returns the List of dependants for this component.
 java.lang.String getDescription()
          Returns a string description of the current component.
 int getId()
          Returns the id of the component.
 java.lang.String getName()
          Returns the name of the component object.
 java.lang.String getTemplate()
          Gets the template file(.TMPL), which is the basis of the class implementation.
 void setClassName(java.lang.String name)
          Sets the name of the class.
 void setCompType(java.lang.String type)
          Sets the Component type i.e class.
 void setDescription(java.lang.String description)
          Adds a description of the class to the object.
 void setId(java.lang.String id)
          Sets an ID value to the class.
 void setTemplate(java.lang.String template)
          Sets the template file(.TMPL), which is the basis of the class implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternClass

public PatternClass()
Creates a new instance of PatternClass


PatternClass

public PatternClass(java.lang.String id,
                    java.lang.String compType,
                    java.lang.String template,
                    java.lang.String description,
                    java.lang.String name)
Creates a new instance of PatternClass

Parameters:
id - The ID number of the component.
template - The path to the template file used to generate the component.
description - Component description.
name - The name of the component.
Method Detail

setTemplate

public void setTemplate(java.lang.String template)
Sets the template file(.TMPL), which is the basis of the class implementation.

Parameters:
template - The name of the template.

getTemplate

public java.lang.String getTemplate()
Gets the template file(.TMPL), which is the basis of the class implementation.

Returns:
The template (.TMPL) file needed to create the component.

setDescription

public void setDescription(java.lang.String description)
Adds a description of the class to the object. This description can then be used during the implementation procedure as required.

Parameters:
description - description The description of the classes purpose.

getDescription

public java.lang.String getDescription()
Returns a string description of the current component.

Returns:
Description of the component.

setClassName

public void setClassName(java.lang.String name)
Sets the name of the class.

This will automatically be set to the defaultName value supplied in the Pattern source file. If unchanged before complete implementation, the class will be implemented with this default name.

Parameters:
name - The name of the class.

getName

public java.lang.String getName()
Returns the name of the component object.

Returns:
The name of the component.

getId

public int getId()
Returns the id of the component.

Returns:
The id value of the component.

setId

public void setId(java.lang.String id)
Sets an ID value to the class.

An id value is required so that any associations between any other classes in the pattern can be made.

Parameters:
id - An integer value represening the classes id.

addDependancy

public void addDependancy(java.lang.String depId)
The PatternClass object maintains a List of other components within the pattern that it must know about during its implementation.

This method adds an id value of one of these components to that list.

Parameters:
depId - The id of the component to be added to the list of dependants.

getDependants

public java.util.List<java.lang.String> getDependants()
Returns the List of dependants for this component. List should be used when generating the source code in order to obtain the correct names of these listed components.

Returns:
A List Strings representing the ID numbers of associated components.

setCompType

public void setCompType(java.lang.String type)
Sets the Component type i.e class.

Parameters:
type - A string representation of the component type.

getCompType

public java.lang.String getCompType()
Returns the component type.

Returns:
The component type.