当前位置: 首页>>代码示例>>Java>>正文


Java SignatureWithParameters类代码示例

本文整理汇总了Java中org.aikodi.chameleon.oo.member.SignatureWithParameters的典型用法代码示例。如果您正苦于以下问题:Java SignatureWithParameters类的具体用法?Java SignatureWithParameters怎么用?Java SignatureWithParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SignatureWithParameters类属于org.aikodi.chameleon.oo.member包,在下文中一共展示了SignatureWithParameters类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: contains

import org.aikodi.chameleon.oo.member.SignatureWithParameters; //导入依赖的package包/类
@Override
	public boolean contains(Declaration first, Declaration second) throws LookupException {
	  boolean result = false;
	  if((!first.sameAs(second)) && (first instanceof Method) && (second instanceof Method)) {
	    Method method1 = (Method) first;
	    Method method2 = (Method) second;
	    	result = !checkDefined(method2);
	    	result = result && first.name().equals(second.name());
	    	if(result) {
	    		SignatureWithParameters signature1 = method1.signature();
	    		SignatureWithParameters signature2 = method2.signature();
	    		result = signature1.sameParameterBoundsAs(signature2);
					if(!result) {
						SignatureWithParameters erasure2 = signature2.language(Java7.class).erasure((SignatureWithParameters) signature2);
						result = signature1.sameParameterBoundsAs(erasure2);
					}
	    		result = result &&
	    		(! method2.nearestAncestor(Type.class).subtypeOf(method1.nearestAncestor(Type.class))) &&
	    		method1.sameKind(method2);
	    	} 
//	    } 
	  }
	  return result; 
	}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:25,代码来源:JavaImplementsRelation.java

示例2: erasure

import org.aikodi.chameleon.oo.member.SignatureWithParameters; //导入依赖的package包/类
public SignatureWithParameters erasure(SignatureWithParameters signature) {
	SignatureWithParameters result = new SignatureWithParameters(signature.name());
	result.setUniParent(signature.parent());
	for(TypeReference tref : signature.typeReferences()) {
		JavaTypeReference jref = (JavaTypeReference) tref;
		JavaTypeReference erasedReference = jref.erasedReference();
		result.add(erasedReference);
	}
	return result;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:11,代码来源:Java7.java

示例3: subSignature

import org.aikodi.chameleon.oo.member.SignatureWithParameters; //导入依赖的package包/类
/** 
 * FIXME This should be used in a validation rule. The check that is done during
 * lookup is {@link Declaration#compatibleSignature(Declaration)}. In correct Java code,
 * the sameAs check for types will give the correct result because any infinite types
 * must have the same structure in both methods anyway. 
 * If the code is not correct, however, that may not be the case. The lookup will then 
 * (correctly) give two results and fail, but the actual error
 * is not in the invocation but in the definition. For now, that is not detected.
 */
private static boolean subSignature(Method first, Method second) throws LookupException {
	boolean result = first.sameKind(second) && ((Type)first.nearestAncestor(Type.class)).subtypeOf((Type)second.nearestAncestor(Type.class));
	if(result) {
		SignatureWithParameters signature1 = first.signature();
		SignatureWithParameters signature2 = second.signature();
		result = signature1.sameParameterBoundsAs(signature2);
		if(!result) {
		   SignatureWithParameters erasure2 = signature2.language(Java7.class).erasure((SignatureWithParameters) signature2);
			result = signature1.sameParameterBoundsAs(erasure2);
		}
	}
	return result;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:23,代码来源:JavaMethod.java

示例4: selectedBasedOnName

import org.aikodi.chameleon.oo.member.SignatureWithParameters; //导入依赖的package包/类
private boolean selectedBasedOnName(Signature signature) throws LookupException {
  	boolean result = false;
	if(signature instanceof SignatureWithParameters) {
		List<Type> actuals = getActualParameterTypes();
		List<Type> formals = ((SignatureWithParameters)signature).parameterTypes();
		if (MoreSpecificTypesOrder.create().contains(actuals, formals)) {
				result = true;
		}
	}
    return result;
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:12,代码来源:SubobjectConstructorCall.java


注:本文中的org.aikodi.chameleon.oo.member.SignatureWithParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。