本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}