package es.uniovi.reflection.patternmining.features;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import es.uniovi.reflection.patternmining.util.Util.NamingSystem;
import es.uniovi.reflection.patternmining.util.Util.NodeType;

public class TypeDefFeatures {
	private long id;
	private long fileId; //information from parent
	public long innerId;
	private boolean isNestedClass;
	private boolean isInnerClass;
	private boolean isStatic;
	private int height;
	private NodeType typeDefinitionCategory;
	private boolean isPublic;
	private boolean isFinalClass;
	private boolean hasExtends;
	private boolean isAbstract;
	private boolean isStrictFP;
	private int numberAnnotations;	
	private int numberImplements;
	private int numberGenericTypes;
	private int numberMethods;
	private float percentageOverloadedMethods;
	private int numberConstructors;
	private int numberFields;
	private int numberNestedTypes;
	private int numberStaticNestedTypes;
	private int numberInnerTypes;
	private NamingSystem typeNaming;
	private int numberOfStaticFields;
	private int numberOfStaticMethods;
	private float staticFieldPercentage;
	private float staticMethodPercentage;
	private int numberStaticBlocks;
	ArrayList<String> methodNames=new ArrayList<String>();
	public long parentId;
	private int numberStaticFields;
	private int numberStaticMethods;
	public String packageName;
	public String typeDefinitionName;
	private String sourceCode;
	private boolean isInDefaultPackage;
	
	Map<String, Integer> mapMethodNames = new HashMap<String, Integer>();
	
	
	public long getParentId() {
		return parentId;
	}
	
	public void setParentId(long parentId) {
		this.parentId = parentId;
	}
	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}
	
	public long getFileId() {
		return fileId;
	}
	
	public void setFileId(long fileId) {
		this.fileId = fileId;
	}
	
	public long getInnerId() {
		return innerId;
	}
	
	public void setInnerId(long l) {
		this.innerId = l;
	}
	
	public boolean isStatic() {
		return isStatic;
	}
	
	public void setStatic(boolean isStatic) {
		this.isStatic = isStatic;
	}
	
	public boolean isNestedClass() {
		return isNestedClass;
	}
	
	public void setNestedClass(boolean isNestedClass) {
		this.isNestedClass = isNestedClass;
	}
	
	public int getHeight() {
		return height;
	}
	
	public void setHeight(int height) {
		this.height = height;
	}
	
	public NodeType getTypeDefinitionCategory() {
		return typeDefinitionCategory;
	}
	public void setTypeDefinitionCategory(NodeType typeDefinitionCategory) {
		this.typeDefinitionCategory = typeDefinitionCategory;
	}
	
	public boolean isPublic() {
		return isPublic;
	}
	
	public void setPublic(boolean isPublic) {
		this.isPublic = isPublic;
	}
	
	public boolean isFinalClass() {
		return isFinalClass;
	}
	
	public void setFinalClass(boolean isFinalClass) {
		this.isFinalClass = isFinalClass;
	}
	
	public boolean isHasExtends() {
		return hasExtends;
	}
	
	public void setHasExtends(boolean hasExtends) {
		this.hasExtends = hasExtends;
	}
	
	public ArrayList<String> getMethodNames() {
		return methodNames;
	}
	
	public void setMethodNames(ArrayList<String> methodNames) {
		this.methodNames = methodNames;
	}
	
	public boolean isAbstract() {
		return isAbstract;
	}
	
	public void setAbstract(boolean isAbstract) {
		this.isAbstract = isAbstract;
	}
	
	public boolean isStrictFP() {
		return isStrictFP;
	}
	
	public void setStrictFP(boolean isStrictFP) {
		this.isStrictFP = isStrictFP;
	}
	
	public int getNumberAnnotations() {
		return numberAnnotations;
	}
	
	public void setNumberAnnotations(int numberAnnotations) {
		this.numberAnnotations = numberAnnotations;
	}
	
	public boolean isInDefaultPackage() {
		return isInDefaultPackage;
	}
	
	public void setIsInDefaultPackage(boolean isInDefaultPackage) {
		this.isInDefaultPackage = isInDefaultPackage;
	}
	
	public int getNumberImplements() {
		return numberImplements;
	}
	
	public void setNumberImplements(int numberImplements) {
		this.numberImplements = numberImplements;
	}
	
	public int getNumberGenericTypes() {
		return numberGenericTypes;
	}
	
	public void setNumberGenericTypes(int numberGenericTypes) {
		this.numberGenericTypes = numberGenericTypes;
	}
	
	public int getNumberMethods() {
		return numberMethods;
	}
	
	public void setNumberMethods(int numberMethods) {
		this.numberMethods = numberMethods;
	}
	
	public float getPercentageOverloadedMethods() {
		return percentageOverloadedMethods;
	}
	
	public void setPercentageOverloadedMethods(float percentageOverloadedMethods) {
		this.percentageOverloadedMethods = percentageOverloadedMethods;
	}
	
	public int getNumberConstructors() {
		return numberConstructors;
	}
	
	public void setNumberConstructors(int numberConstructors) {
		this.numberConstructors = numberConstructors;
	}
	
	public int getNumberFields() {
		return numberFields;
	}
	
	public void setNumberFields(int numberFields) {
		this.numberFields = numberFields;
	}

	public int getNumberNestedTypes() {
		return numberNestedTypes;
	}

	public void setNumberNestedTypes(int numberNestedTypes) {
		this.numberNestedTypes = numberNestedTypes;
	}

	public int getNumberStaticNestedTypes() {
		return numberStaticNestedTypes;
	}

	public void setNumberStaticNestedTypes(int numberStaticNestedTypes) {
		this.numberStaticNestedTypes = numberStaticNestedTypes;
	}

	public int getNumberInnerTypes() {
		return numberInnerTypes;
	}

	public void setNumberInnerTypes(int numberInnerTypes) {
		this.numberInnerTypes = numberInnerTypes;
	}

	public int getNumberOfStaticFields() {
		return numberOfStaticFields;
	}

	public void setNumberOfStaticFields(int numberOfStaticFields) {
		this.numberOfStaticFields = numberOfStaticFields;
	}

	public int getNumberOfStaticMethods() {
		return numberOfStaticMethods;
	}

	public void setNumberOfStaticMethods(int numberOfStaticMethods) {
		this.numberOfStaticMethods = numberOfStaticMethods;
	}

	public float getStaticFieldPercentage() {
		return staticFieldPercentage;
	}
	
	public void setStaticFieldPercentage(float staticFieldPercentage) {
		this.staticFieldPercentage = staticFieldPercentage;
	}
	
	public float getStaticMethodPercentage() {
		return staticMethodPercentage;
	}
	
	public void setStaticMethodPercentage(float staticMethodPercentage) {
		this.staticMethodPercentage = staticMethodPercentage;
	}
	
	public int getNumberStaticBlocks() {
		return numberStaticBlocks;
	}
	
	public void setNumberStaticBlocks(int numberStaticBlocks) {
		this.numberStaticBlocks = numberStaticBlocks;
	}
	
	public NamingSystem getTypeNaming() {
		return typeNaming;
	}
	
	public void setTypeNaming(NamingSystem typeNaming) {
		this.typeNaming = typeNaming;
	}
	
	public boolean getIfMethodNameExists(String methodName) {
		return methodNames.contains(methodName);
	}
	
	public void setNewMethodName(String methodName) {
		methodNames.add(methodName);
	}
	
	public int getNumberStaticFields() {
		return numberStaticFields;
	}
	
	public void setNumberStaticFields(int numberStaticFields) {
		this.numberStaticFields = numberStaticFields;
	}
	
	public int getNumberStaticMethods() {
		return numberStaticMethods;
	}
	
	public void setNumberStaticMethods(int numberStaticMethods) {
		this.numberStaticMethods = numberStaticMethods;
	}
	
	public boolean isInnerClass() {
		return isInnerClass;
	}
	
	public void setInnerClass(boolean isInnerClass) {
		this.isInnerClass = isInnerClass;
	}

	public Map<String, Integer> getMapMethodNames() {
		return mapMethodNames;
	}

	public void setMapMethodNames(Map<String, Integer> mapMethodNames) {
		this.mapMethodNames = mapMethodNames;
	}
	
	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 String getSourceCode() {
		return sourceCode;
	}

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

	@Override
	public String toString() {
		return "TypeDefFeatures [id=" + id + ", fileId=" + fileId + ", innerId=" + innerId + ", isNestedClass="
				+ isNestedClass + ", isInnerClass=" + isInnerClass + ", isStatic=" + isStatic + ", height=" + height
				+ ", typeDefinitionCategory=" + typeDefinitionCategory + ", isPublic=" + isPublic + ", isFinalClass="
				+ isFinalClass + ", hasExtends=" + hasExtends + ", isAbstract=" + isAbstract + ", isStrictFP="
				+ isStrictFP + ", numberAnnotations=" + numberAnnotations + ", isInDefaultPackage=" + isInDefaultPackage
				+ ", numberImplements=" + numberImplements + ", numberGenericTypes=" + numberGenericTypes
				+ ", numberMethods=" + numberMethods + ", percentageOverloadedMethods=" + percentageOverloadedMethods
				+ ", numberConstructors=" + numberConstructors + ", numberFields=" + numberFields
				+ ", numberNestedTypes=" + numberNestedTypes + ", numberStaticNestedTypes=" + numberStaticNestedTypes
				+ ", numberInnerTypes=" + numberInnerTypes + ", typeNaming=" + typeNaming + ", numberOfStaticFields="
				+ numberOfStaticFields + ", numberOfStaticMethods=" + numberOfStaticMethods + ", staticFieldPercentage="
				+ staticFieldPercentage + ", staticMethodPercentage=" + staticMethodPercentage + ", numberStaticBlocks="
				+ numberStaticBlocks + ", methodNames=" + methodNames + ", parentId=" + parentId
				+ ", numberStaticFields=" + numberStaticFields + ", numberStaticMethods=" + numberStaticMethods
				+ ", packageName=" + packageName + ", typeDefinitionName=" + typeDefinitionName + ", sourceCode="
				+ sourceCode + ", mapMethodNames=" + mapMethodNames + "]";
	}

}
