|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.topcoder.shared.language.BaseLanguage
The BaseLanguage class is the implementation of all the
semantics associated with a supported programming language. This
basically consists of the logic for generating language-dependent
method signatures. An instance of type Language also
servers as a convenient identifier for a particular language.
DataType,
Serialized Form| Constructor Summary | |
BaseLanguage()
Empty constructor |
|
BaseLanguage(int id,
java.lang.String name)
Constructs a language with the specified id and descriptor. |
|
| Method Summary | |
void |
customReadObject(com.topcoder.shared.netCommon.CSReader reader)
Custom serialization. |
void |
customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
Custom serialization. |
boolean |
equals(java.lang.Object o)
Two languages are equal if they have the same identifier. |
int |
getId()
Returns the unique language identifier. |
static Language |
getLanguage(int typeID)
Helper method to return a Language for the identifier. |
abstract java.lang.String |
getMethodSignature(java.lang.String methodName,
DataType returnType,
DataType[] paramTypes,
java.lang.String[] paramNames)
Dependents of this class should implement the getMethodSignature. |
java.lang.String |
getName()
Returns the language descriptor (or name) such as "Java" or "C++". |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BaseLanguage()
public BaseLanguage(int id,
java.lang.String name)
id - the identifier of the language.name - the descriptor of the language.| Method Detail |
public int getId()
getId in interface Languagepublic java.lang.String getName()
getName in interface Languagepublic boolean equals(java.lang.Object o)
equals in interface Languageequals in class java.lang.Object
public void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
throws java.io.IOException
customWriteObject in interface Languagewriter - the writer to write to.
java.io.IOException - if an I/O error has occurred in the stream that backs the writer.
public void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
throws java.io.IOException,
java.io.ObjectStreamException
customReadObject in interface Languagereader - the reader to read from.
java.io.ObjectStreamException - if the information that is read is inconsistent (stream corrupted
or incompatibility between writers and readers)
java.io.IOException - if an I/O error has occurred in the stream that backs the reader.
public abstract java.lang.String getMethodSignature(java.lang.String methodName,
DataType returnType,
DataType[] paramTypes,
java.lang.String[] paramNames)
getMethodSignature in interface LanguagemethodName - the name of the method.returnType - the datatype that will be returned by the method.paramTypes - the datatype of the parameters of the method.paramNames - the name of parameters of the method.
Language.getMethodSignature(String, DataType, DataType[], String[])public static Language getLanguage(int typeID)
typeID - the language identifier.
java.lang.IllegalArgumentException - of typeID is unknown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||