org.moyoman.helper
Class HelperType

java.lang.Object
  |
  +--org.moyoman.helper.HelperType
All Implemented Interfaces:
ComponentType, Serializable

public class HelperType
extends Object
implements ComponentType, Serializable

This class represents a helper type, e.g, RulesHelper. Only one instance is created for each type.

See Also:
Serialized Form

Field Summary
private  String full
          The full name, e.g, org.moyoman.helper.board.rules.RulesHelper.
private static HashMap hm
          The key is the simple or full name, and the value is the HelperType object.
private  ComponentType parent
          The parent type of this one.
private  String simple
          The simple name, e.g, RulesHelper.
 
Constructor Summary
protected HelperType(String s, String f)
          Create a new HelperType object.
protected HelperType(String s, String f, ComponentType comp)
           
 
Method Summary
 boolean equals(Object o)
          Compare this object with another for equality.
 String getFullName()
          Return the full type, e.g, org.moyoman.helper.board.rules.RulesHelper.
static HelperType getHelperType(String name)
          Get the helper type object of the given name.
 ComponentType getParent()
          Get the ComponentType with which this HelperType is associated.
 String getSimpleName()
          Return the interface name, e.g, RulesHelper.
 int hashCode()
          Get a hash code for this object.
protected  void setParent(ComponentType comp)
          Set the parent type of this helper type.
 String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hm

private static HashMap hm
The key is the simple or full name, and the value is the HelperType object.


simple

private String simple
The simple name, e.g, RulesHelper.


full

private String full
The full name, e.g, org.moyoman.helper.board.rules.RulesHelper.


parent

private ComponentType parent
The parent type of this one.

Constructor Detail

HelperType

protected HelperType(String s,
                     String f)
              throws IllegalArgumentException,
                     DataAlreadyExistsException
Create a new HelperType object.

Parameters:
s - The simple name
f - The full name.
Throws:
IllegalArgumentException - Thrown if either s or f is null.
DataAlreadyExistsException

HelperType

protected HelperType(String s,
                     String f,
                     ComponentType comp)
              throws IllegalArgumentException,
                     DataAlreadyExistsException
Method Detail

setParent

protected void setParent(ComponentType comp)
Set the parent type of this helper type.

Parameters:
comp - The parent of this helper type.

getFullName

public String getFullName()
Return the full type, e.g, org.moyoman.helper.board.rules.RulesHelper.

Returns:
The full type name.

getParent

public ComponentType getParent()
Get the ComponentType with which this HelperType is associated. A ComponentType is either a ModuleType, or a HelperType.


getSimpleName

public String getSimpleName()
Return the interface name, e.g, RulesHelper.

Returns:
The interface name.

getHelperType

public static HelperType getHelperType(String name)
                                throws NoSuchDataException
Get the helper type object of the given name.

Parameters:
name - The name of the helper type object.
Returns:
A HelperType object.
Throws:
NoSuchDataException - Thrown if there is not HelperType object by that name.

hashCode

public int hashCode()
Get a hash code for this object.

Overrides:
hashCode in class Object
Returns:
An int which is the hash code.

equals

public boolean equals(Object o)
Compare this object with another for equality.

Overrides:
equals in class Object
Parameters:
o - The object being compared with this one.
Returns:
true if the two objects are the same, or false.

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object
Returns:
A String which represents this object.