com.topcoder.shared.language
Class CStyleLanguage

java.lang.Object
  |
  +--com.topcoder.shared.language.BaseLanguage
        |
        +--com.topcoder.shared.language.CStyleLanguage
All Implemented Interfaces:
java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable, Language, java.io.Serializable
Direct Known Subclasses:
CPPLanguage, CSharpLanguage, JavaLanguage

public class CStyleLanguage
extends BaseLanguage

A ``C-style'' language is one in which method signatures are specified as return-type method-name (params...). Currently every language TopCoder supports is a C-style language in this regard, and thus this class captures the semantics common to C++, C#, and Java.

Author:
Logan Hanks
See Also:
Language, BaseLanguage, Serialized Form

Constructor Summary
CStyleLanguage()
          Empty constructor.
CStyleLanguage(int id, java.lang.String description)
          Constructs a CSytleLanguage.
 
Method Summary
 java.lang.String getMethodSignature(java.lang.String methodName, DataType returnType, DataType[] paramTypes, java.lang.String[] paramNames)
          Creates a C-style method signature for the given parameters specific to the language.
 
Methods inherited from class com.topcoder.shared.language.BaseLanguage
customReadObject, customWriteObject, equals, getId, getLanguage, getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CStyleLanguage

public CStyleLanguage()
Empty constructor.


CStyleLanguage

public CStyleLanguage(int id,
                      java.lang.String description)
Constructs a CSytleLanguage.

Parameters:
id - the language identifier.
description - the language descriptor.
Method Detail

getMethodSignature

public java.lang.String getMethodSignature(java.lang.String methodName,
                                           DataType returnType,
                                           DataType[] paramTypes,
                                           java.lang.String[] paramNames)
Creates a C-style method signature for the given parameters specific to the language.

Specified by:
getMethodSignature in interface Language
Specified by:
getMethodSignature in class BaseLanguage
Parameters:
methodName - 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.
Returns:
the formatted method signature specific to the language.
See Also:
DataType, Language.getMethodSignature(String, DataType, DataType[], String[])