mirror of
https://github.com/chylex/Code-Statistics.git
synced 2024-11-24 12:42:46 +01:00
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace LanguageJava.Elements{
|
|
public class Method : Member{
|
|
public const string ConstructorIdentifier = "<explinit>"; // explicit constructor
|
|
|
|
public readonly string Identifier;
|
|
public readonly TypeOf ReturnType;
|
|
public readonly ReadOnlyCollection<TypeOf> ParameterTypes;
|
|
|
|
public bool IsConstructor { get { return Identifier == ConstructorIdentifier; } }
|
|
|
|
public Method(string identifier, TypeOf returnType, List<TypeOf> parameterTypes, Member info) : base(info){
|
|
this.Identifier = identifier;
|
|
this.ReturnType = returnType;
|
|
this.ParameterTypes = parameterTypes.AsReadOnly();
|
|
}
|
|
|
|
public Method(string identifier, TypeOf returnType, Member info) : base(info){
|
|
this.Identifier = identifier;
|
|
this.ReturnType = returnType;
|
|
this.ParameterTypes = TypeOf.EmptyList();
|
|
}
|
|
|
|
public override string ToString(){
|
|
return base.ToString()+ReturnType+' '+Identifier+'('+string.Join(", ", ParameterTypes)+')';
|
|
}
|
|
}
|
|
}
|