All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dragome.compiler.units.MethodUnit Maven / Gradle / Ivy

There is a newer version: 0.96-beta4
Show newest version
package com.dragome.compiler.units;

import com.dragome.compiler.type.Signature;

public class MethodUnit extends ProcedureUnit
{

	private String nameAndSignature;

	public String getNameAndSignature()
	{
		return nameAndSignature;
	}

	public MethodUnit(Signature theSignature, ClassUnit theDeclaringClazz, String nameAndSignature)
	{
		super(theSignature, theDeclaringClazz);
		this.nameAndSignature= nameAndSignature;
	}

	@Override
	public int hashCode()
	{
		final int prime= 31;
		int result= 1;
		result= prime * result + ((getSignature().toString() == null) ? 0 : getSignature().toString().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MethodUnit other= (MethodUnit) obj;
		if (getSignature().toString() == null)
		{
			if (other.getSignature().toString() != null)
				return false;
		}
		else if (!getSignature().toString().equals(other.getSignature().toString()))
			return false;
		return true;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy