package es.uniovi.reflection.patternmining.features;

import java.util.Arrays;

import es.uniovi.reflection.patternmining.category.Others;
import es.uniovi.reflection.patternmining.category.TypeCategory;
import es.uniovi.reflection.patternmining.model.interfaces.ParameterType;
import es.uniovi.reflection.patternmining.util.Util.NamingSystem;
import es.uniovi.reflection.patternmining.util.Util.Visibility;

public class MethodFeatures {
	 
	public long id;
	public long idParent = 0; //information from parent
	public int height;
	public Visibility methodVisibility;
	public boolean isDefaultImplementation;
	public boolean isFinal;
	public boolean hasOverride;
	public boolean isStatic;
	public boolean isAbstract;
	public boolean isConstructor;
	private boolean isSynchronized;
	private boolean isStrictFP;
	private boolean isNative;
	public int numberParameters;
	public int numberGenericTypes;
	public int numberThrows;
	public ParameterType returnType = Others.None;
	public ParameterType firstParameterType = Others.None;
	public ParameterType secondParameterType = Others.None;
	public ParameterType thirdParameterType = Others.None;
	public int numberAnnotations;
	public int numberStatements;
	public int methodLocalVars;
	public NamingSystem locVarNaming = NamingSystem.NOT_KNOWN;
	public NamingSystem methodNaming = NamingSystem.NOT_KNOWN;
	public int [] localVarStat = new int [5];
	public int numberInnerClasses = 0;
	private int numberOfOverloaded;
	private long firstTypeParameterId;
	private long secondTypeParameterId;
	private long thirdTypeParameterId;
	private long returnTypeParameterId;
	private String packageName;
	public String typeDefinitionName;
	private boolean isParameterType;
	private String sourceCode;
	 
	 
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}
	
	public long getIdParent() {
		return idParent;
	}
	
	public void setIdParent(long idParent) {
		this.idParent = idParent;
	}
	
	public int getHeight() {
		return height;
	}
	
	public void setHeight(int height) {
		this.height = height;
	}
	
	public int[] getLocalVarStat() {
		return localVarStat;
	}
	
	public void setLocalVarStat(int[] localVarStat) {
		this.localVarStat = localVarStat;
	}
	
	public Visibility getMethodVisibility() {
		return methodVisibility;
	}
	
	public void setMethodVisibility(Visibility methodVisibility) {
		this.methodVisibility = methodVisibility;
	}
	
	public boolean isDefaultImplementation() {
		return isDefaultImplementation;
	}
	
	public void setDefaultImplementation(boolean isDefaultImplementation) {
		this.isDefaultImplementation = isDefaultImplementation;
	}
	
	public boolean isFinal() {
		return isFinal;
	}
	
	public void setFinal(boolean isFinal) {
		this.isFinal = isFinal;
	}
	
	public boolean hasOverride() {
		return hasOverride;
	}
	
	public void setHasOverride(boolean hasOverride) {
		this.hasOverride = hasOverride;
	}
	
	public boolean isStatic() {
		return isStatic;
	}
	
	public void setStatic(boolean isStatic) {
		this.isStatic = isStatic;
	}
	
	public boolean isAbstract() {
		return isAbstract;
	}
	
	public void setAbstract(boolean isAbstract) {
		this.isAbstract = isAbstract;
	}
	
	public boolean isConstructor() {
		return isConstructor;
	}
	
	public void setConstructor(boolean isConstructor) {
		this.isConstructor = isConstructor;
	}
	
	public boolean isSynchronized() {
		return isSynchronized;
	}
	
	public void setSynchronized(boolean isSynchronized) {
		this.isSynchronized = isSynchronized;
	}
	
	public boolean isStrictFP() {
		return isStrictFP;
	}
	
	public void setStrictFP(boolean isStrictFP) {
		this.isStrictFP = isStrictFP;
	}
	
	public boolean isNative() {
		return isNative;
	}
	
	public void setNative(boolean isNative) {
		this.isNative = isNative;
	}
	
	public int getNumberParameters() {
		return numberParameters;
	}
	
	public void setNumberParameters(int numberParameters) {
		this.numberParameters = numberParameters;
	}
	
	public int getNumberGenericTypes() {
		return numberGenericTypes;
	}
	
	public void setNumberGenericTypes(int numberGenericTypes) {
		this.numberGenericTypes = numberGenericTypes;
	}
	
	public int getNumberThrows() {
		return numberThrows;
	}
	
	public void setNumberThrows(int numberThrows) {
		this.numberThrows = numberThrows;
	}
	
	public ParameterType getReturnType() {
		return returnType;
	}
	
	public void setReturnType(ParameterType returnType) {
		this.returnType = returnType;
	}
	
	public ParameterType getFirstParameterType() {
		return firstParameterType;
	}

	public void setFirstParameterType(ParameterType firstParameterType) {
		this.firstParameterType = firstParameterType;
	}

	public ParameterType getSecondParameterType() {
		return secondParameterType;
	}

	public void setSecondParameterType(ParameterType secondParameterType) {
		this.secondParameterType = secondParameterType;
	}

	public ParameterType getThirdParameterType() {
		return thirdParameterType;
	}

	public void setThirdParameterType(ParameterType thirdParameterType) {
		this.thirdParameterType = thirdParameterType;
	}

	public int getNumberAnnotations() {
		return numberAnnotations;
	}
	
	public void setNumberAnnotations(int numberAnnotations) {
		this.numberAnnotations = numberAnnotations;
	}
	
	public int getNumberStatements() {
		return numberStatements;
	}
	
	public void setNumberStatements(int numberStatements) {
		this.numberStatements = numberStatements;
	}
	
	public int getMethodLocalVars() {
		return methodLocalVars;
	}
	
	public void setMethodLocalVars(int methodLocalVars) {
		this.methodLocalVars = methodLocalVars;
	}
	
	public NamingSystem getLocVarNaming() {
		return locVarNaming;
	}
	
	public void setLocVarNaming(NamingSystem locVarNaming) {
		this.locVarNaming = locVarNaming;
	}
	
	public NamingSystem getMethodNaming() {
		return methodNaming;
	}
	
	public void setMethodNaming(NamingSystem methodNaming) {
		this.methodNaming = methodNaming;
	}
	
	public int getNumberInnerClasses() {
		return numberInnerClasses;
	}
	
	public void setNumberInnerClasses(int numberInnerClasses) {
		this.numberInnerClasses = numberInnerClasses;
	}

	public int getNumberOfOverloaded() {
		return numberOfOverloaded;
	}

	public void setNumberOfOverloaded(int numberOfOverloaded) {
		this.numberOfOverloaded = numberOfOverloaded;
	}

	public boolean isHasOverride() {
		return hasOverride;
	}
	
	public long getFirstTypeParameterId() {
		return firstTypeParameterId;
	}

	public void setFirstTypeParameterId(long firstTypeParameterId) {
		this.firstTypeParameterId = firstTypeParameterId;
	}

	public long getSecondTypeParameterId() {
		return secondTypeParameterId;
	}

	public void setSecondTypeParameterId(long secondTypeParameterId) {
		this.secondTypeParameterId = secondTypeParameterId;
	}

	public long getThirdTypeParameterId() {
		return thirdTypeParameterId;
	}

	public void setThirdTypeParameterId(long thirdTypeParameterId) {
		this.thirdTypeParameterId = thirdTypeParameterId;
	}

	public long getReturnTypeParameterId() {
		return returnTypeParameterId;
	}
	
	public void setReturnTypeParameterId(long returnTypeParameterId) {
		this.returnTypeParameterId = returnTypeParameterId;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getTypeDefinitionName() {
		return typeDefinitionName;
	}

	public void setTypeDefinitionName(String typeDefinitionName) {
		this.typeDefinitionName = typeDefinitionName;
	}

	public boolean isParameterType() {
		return isParameterType;
	}

	public void setParameterType(boolean isParameterType) {
		this.isParameterType = isParameterType;
	}

	public String getSourceCode() {
		return sourceCode;
	}

	public void setSourceCode(String sourceCode) {
		this.sourceCode = sourceCode;
	}

	@Override
	public String toString() {
		return "MethodFeatures [id=" + id + ", idParent=" + idParent + ", height=" + height + ", methodVisibility="
				+ methodVisibility + ", isDefaultImplementation=" + isDefaultImplementation + ", isFinal=" + isFinal
				+ ", hasOverride=" + hasOverride + ", isStatic=" + isStatic + ", isAbstract=" + isAbstract
				+ ", isConstructor=" + isConstructor + ", isSynchronized=" + isSynchronized + ", isStrictFP="
				+ isStrictFP + ", isNative=" + isNative + ", numberParameters=" + numberParameters
				+ ", numberGenericTypes=" + numberGenericTypes + ", numberThrows=" + numberThrows + ", returnType="
				+ returnType + ", firstParameterType=" + firstParameterType + ", secondParameterType="
				+ secondParameterType + ", thirdParameterType=" + thirdParameterType + ", numberAnnotations="
				+ numberAnnotations + ", numberStatements=" + numberStatements + ", methodLocalVars=" + methodLocalVars
				+ ", locVarNaming=" + locVarNaming + ", methodNaming=" + methodNaming + ", localVarStat="
				+ Arrays.toString(localVarStat) + ", numberInnerClasses=" + numberInnerClasses + ", numberOfOverloaded="
				+ numberOfOverloaded + ", firstTypeParameterId=" + firstTypeParameterId + ", secondTypeParameterId="
				+ secondTypeParameterId + ", thirdTypeParameterId=" + thirdTypeParameterId + ", returnTypeParameterId="
				+ returnTypeParameterId + ", packageName=" + packageName + ", typeDefinitionName=" + typeDefinitionName
				+ ", isParameterType=" + isParameterType + ", sourceCode=" + sourceCode + "]";
	}
 	
}
