|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.module.ModuleType
This class represents a module type, e.g, Shape. There is only one object instantiated for each module type. The static getModuleType() method is used to retrieve it. This class is implemented this way because otherwise there could be conceivably thousands of extra objects instantiated which would serve no useful purpose.
Field Summary | |
private String |
full
The full name, e.g, org.moyoman.module.shape.Shape |
private static HashMap |
hm
The key is the simple name or full name, the value is the ModuleType object. |
private String |
simple
The simple name, e.g, Shape. |
Constructor Summary | |
protected |
ModuleType(String s,
String f)
Create the ModuleType object without any error checking. |
Method Summary | |
boolean |
equals(Object o)
Compare this object with another one for equality. |
String |
getFullName()
Return the full type, e.g, org.moyoman.module.shape.Shape. |
static ModuleType |
getModuleType(String type)
Create the ModuleType object. |
String |
getSimpleName()
Return the interface name, e.g, Shape. |
int |
hashCode()
Get a hash code for the object. |
String |
toString()
Return a representation of this object as a String. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static HashMap hm
private String simple
private String full
Constructor Detail |
protected ModuleType(String s, String f)
s
- The simple module type namef
- The full module type name.Method Detail |
public static ModuleType getModuleType(String type) throws NoSuchDataException
type
- The name of the type. Shape, or
org.moyoman.module.shape.Shape are acceptable.
NoSuchDataException
- Thrown if there is no corresponding module type.public String getFullName()
public String getSimpleName()
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
o
- The object being compared with this one.
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |