com.dragome.compiler.units.MethodUnit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dragome-bytecode-js-compiler Show documentation
Show all versions of dragome-bytecode-js-compiler Show documentation
Dragome SDK module: bytecode to javascript compiler
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;
}
}