當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。