org.moyoman.helper
Class HelperName

java.lang.Object
  |
  +--org.moyoman.helper.HelperName
All Implemented Interfaces:
Serializable

public class HelperName
extends Object
implements Serializable

This class represents a helper name, e.g, org.moyoman.helper.joseki.dictionary.dict1.Dict1.

See Also:
Serialized Form

Field Summary
private  String full
          The full name of the helper name.
private static HashMap helperNames
          The key is either the simple or full name, and the value is the HelperName object.
private  String simple
          The simple name of the helper name.
private  HelperType type
          The HelperType that this helper name is associated with.
 
Constructor Summary
protected HelperName(String simpleName, String fullName, HelperType helperType)
          Create a new HelperName object.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another one for equality.
 String getFullName()
          Get the fully qualified name, e.g, org.moyoman.helper.joseki.dictionary.dict1.Dict1.
static HelperName getHelperName(String name)
          Get the helper name object with the given name.
 HelperType getHelperType()
          Return the helper type that this helper name is associated with.
 String getSimpleName()
          The helper name, e.g, Dict1.
 int hashCode()
          Get the hash code for this object.
 String toString()
          Return a String representation of this object.
 String typeAndNameString()
          Return a string representing the helper name and associated helper type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

helperNames

private static HashMap helperNames
The key is either the simple or full name, and the value is the HelperName object.


type

private HelperType type
The HelperType that this helper name is associated with.


simple

private String simple
The simple name of the helper name.


full

private String full
The full name of the helper name.

Constructor Detail

HelperName

protected HelperName(String simpleName,
                     String fullName,
                     HelperType helperType)
Create a new HelperName object. Note that there is no intelligence or error checking here. Only the HelperConfig class can create a HelperName object, and it does all of the error checking on the arguments.

Parameters:
simpleName - The helper name, e.g, Dict1,
fullName - The full helper name, e.g, org.moyoman.joseki.dictionary.dict1.Dict1.
helperType - The helper type.
Method Detail

getHelperName

public static HelperName getHelperName(String name)
                                throws NoSuchDataException
Get the helper name object with the given name.

Parameters:
name - Either the simple or full name.
Returns:
A HelperName object.
Throws:
NoSuchDataException - Thrown if the helper name does not exist.

getFullName

public String getFullName()
Get the fully qualified name, e.g, org.moyoman.helper.joseki.dictionary.dict1.Dict1.

Returns:
The fully qualified helper name.

getSimpleName

public String getSimpleName()
The helper name, e.g, Dict1.

Returns:
The helper name.

getHelperType

public HelperType getHelperType()
Return the helper type that this helper name is associated with.

Returns:
The helper type.

hashCode

public int hashCode()
Get the 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 one for equality.

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

typeAndNameString

public String typeAndNameString()
Return a string representing the helper name and associated helper type.

Returns:
A String representing this object.

toString

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

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