com.topcoder.shared.language
Interface Language

All Superinterfaces:
java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable, java.io.Serializable
All Known Implementing Classes:
BaseLanguage

public interface Language
extends java.io.Serializable, java.lang.Cloneable, com.topcoder.shared.netCommon.CustomSerializable

The interface for 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 serves as a convenient identifier for a particular language.

Author:
Logan Hanks
See Also:
DataType

Method Summary
 void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
          Custom serialization method.
 void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
          Custom serialization method.
 boolean equals(java.lang.Object o)
          Two languages are equal if they have the same id.
 int getId()
          Returns the unique identifier of the language.
 java.lang.String getMethodSignature(java.lang.String methodName, DataType returnType, DataType[] paramTypes, java.lang.String[] paramNames)
          Creates a method signature for the given parameters specific to the language.
 java.lang.String getName()
          Returns the textual name for the language such as "Java" or "C++".
 

Method Detail

getId

public int getId()
Returns the unique identifier of the language.

Returns:
the unique identifier of the language.

getName

public java.lang.String getName()
Returns the textual name for the language such as "Java" or "C++".

Returns:
the textual name for the language such as "Java" or "C++".

equals

public boolean equals(java.lang.Object o)
Two languages are equal if they have the same id.

Overrides:
equals in class java.lang.Object
Returns:
true if equal, false if not.

customWriteObject

public void customWriteObject(com.topcoder.shared.netCommon.CSWriter writer)
                       throws java.io.IOException
Custom serialization method.

Specified by:
customWriteObject in interface com.topcoder.shared.netCommon.CustomSerializable
Parameters:
writer - the writer to write to.
Throws:
java.io.IOException - if an I/O error has occurred in the stream that backs the writer.

customReadObject

public void customReadObject(com.topcoder.shared.netCommon.CSReader reader)
                      throws java.io.IOException,
                             java.io.ObjectStreamException
Custom serialization method.

Specified by:
customReadObject in interface com.topcoder.shared.netCommon.CustomSerializable
Parameters:
reader - the reader to read from.
Throws:
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.

getMethodSignature

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

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