本文整理汇总了Java中org.aikodi.chameleon.core.lookup.SelectionResult类的典型用法代码示例。如果您正苦于以下问题:Java SelectionResult类的具体用法?Java SelectionResult怎么用?Java SelectionResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectionResult类属于org.aikodi.chameleon.core.lookup包,在下文中一共展示了SelectionResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: directImports
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@Override
public <D extends Declaration> List<? extends SelectionResult> directImports(DeclarationSelector<D> selector) throws LookupException {
Type container = typeReference().getElement();
List<SelectionResult> result = new ArrayList<>();
if(selector.selectionName(container).equals(name())) {
List<SelectionResult> members = container.members((DeclarationSelector)selector);
for(SelectionResult member: members) {
if(member.finalDeclaration().name().equals(name())) {
result.add(member);
}
}
}
return result;
// if(selector.selectionName(container).equals(name())) {
// result = container.declarations(selector);
// } else {
// result = Lists.create();
// }
// return result;
}
示例2: removeNonMostSpecificMembers
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
protected
<X extends Declaration> List<SelectionResult<X>> removeNonMostSpecificMembers(List<SelectionResult<X>> current, final List<SelectionResult<X>> potential) throws LookupException {
final List<SelectionResult<X>> toAdd = new ArrayList<SelectionResult<X>>();
for(SelectionResult<X> mm: potential) {
Declaration m = (Declaration) mm.finalDeclaration();
boolean add = true;
Iterator<SelectionResult<X>> iterCurrent = current.iterator();
while(add && iterCurrent.hasNext()) {
Declaration alreadyInherited = (Declaration) iterCurrent.next().finalDeclaration();
// Remove the already inherited member if potentially inherited member m overrides or hides it.
if((alreadyInherited.sameAs(m) || alreadyInherited.compatibleSignature(m) || alreadyInherited.hides(m))) {
add = false;
} else if((!alreadyInherited.sameAs(m)) && (m.compatibleSignature(alreadyInherited) || m.hides(alreadyInherited))) {
iterCurrent.remove();
}
}
if(add == true) {
toAdd.add(mm);
}
}
current.addAll(toAdd);
return current;
}
示例3: declarations
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
protected <D extends Declaration> List<? extends SelectionResult> declarations(DeclarationSelector<D> selector) throws LookupException {
List<? extends SelectionResult> result = declarationContainer().declarations(selector);
if(declarationContainer() != declarationContainer().defaultNamespace()) {
new TypeFilter(Namespace.class).discard(result);
}
return result;
}
示例4: declarations
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@Override
public <D extends Declaration> List<? extends SelectionResult<D>> declarations(DeclarationSelector<D> selector)
throws LookupException {
Type captureConversion = captureConversion();
List<? extends SelectionResult<D>> result;
if(captureConversion != this) {
result = captureConversion.declarations(selector);
} else {
result = super.declarations(selector);
}
return result;
}
示例5: selector
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
public DeclarationSelector<Declaration> selector() {
return new TwoPhaseDeclarationSelector<Declaration>() {
// @Override
// public WeakPartialOrder<Member> order() {
// return new SelectorWithoutOrder.EqualityOrder<Member>();
// }
@Override
protected void applyOrder(List<SelectionResult<Declaration>> tmp) throws LookupException {
}
@Override
public boolean selectedBasedOnName(Signature signature) throws LookupException {
return signature.name().equals(name());
}
@Override
public Class<Declaration> selectedClass() {
return Declaration.class;
}
@Override
public boolean selectedRegardlessOfName(Declaration declaration) throws LookupException {
ObjectOrientedLanguage language = (ObjectOrientedLanguage) declaration.language(ObjectOrientedLanguage.class);
return declaration.is(language.CLASS) == Ternary.TRUE;
}
@Override
public String selectionName(DeclarationContainer container) throws LookupException {
return name();
}
};
}
示例6: incorporated
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
private <M extends Declaration> List<SelectionResult<M>> incorporated(List<? extends SelectionResult<M>> tmp) throws LookupException {
Subobject componentRelation = componentType().nearestAncestor(Subobject.class);
List<SelectionResult<M>> result = new ArrayList<>();
for(SelectionResult<M> r:tmp) {
Declaration decl = r.template();
SelectionResult<M> inc = r.updatedTo(componentRelation.incorporatedIntoComponentType((Declaration)decl));
result.add(inc);
}
return result;
}
示例7: selection
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
public List<? extends SelectionResult<NormalMethod>> selection(List<? extends Declaration> declarators) throws LookupException {
List<SelectionResult<NormalMethod>> tmp = new ArrayList<SelectionResult<NormalMethod>>();
for(Declaration decl: declarators) {
SelectionResult<NormalMethod> e = selection(decl);
if(e != null) {
tmp.add(e);
}
}
applyOrder(tmp);
return tmp;
}
示例8: order
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
public WeakPartialOrder<SelectionResult> order() {
return new WeakPartialOrder<SelectionResult>() {
@Override
public boolean contains(SelectionResult first, SelectionResult second)
throws LookupException {
return MoreSpecificTypesOrder.create().contains(((Method)first.finalDeclaration()).header().formalParameterTypes(), ((Method)second.finalDeclaration()).header().formalParameterTypes());
}
};
}
示例9: incorporated
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
private <M extends Declaration> List<SelectionResult<M>> incorporated(
List<SelectionResult<M>> superMembers) throws LookupException {
List<SelectionResult<M>> result = new ArrayList<>(superMembers.size());
for(SelectionResult<M> m: superMembers) {
result.add(incorporated(m));
}
return result;
}
示例10: filter
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void filter(List<? extends SelectionResult<M>> selected) throws LookupException {
applyOrder((List)selected);
}
示例11: selection
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
public List<? extends SelectionResult<NormalMethod>> selection(List<? extends Declaration> selectionCandidates) throws LookupException {
return super.selection(withoutNonConstructors(selectionCandidates));
}
示例12: updatedTo
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@Override
public SelectionResult<NormalMethod> updatedTo(Declaration declaration) {
return new ConstructorSelectionResult((NormalMethod) declaration, typeAssignment(), phase(),
requiredUncheckedConversion());
}
示例13: updatedTo
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@Override
public SelectionResult<M> updatedTo(Declaration declaration) {
Method method = (Method) declaration;
TypeAssignmentSet assignment = _assignment == null ? null : _assignment.updatedTo(method.typeParameters());
return new BasicMethodSelectionResult<M>((M) method, assignment, _phase,_requiredUncheckedConversion);
}
示例14: declarations
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
public <D extends Declaration> List<? extends SelectionResult<D>> declarations(DeclarationSelector<D> selector) throws LookupException {
return selector.selection(declarations());
}
示例15: implicitMembers
import org.aikodi.chameleon.core.lookup.SelectionResult; //导入依赖的package包/类
@Override
public <D extends Declaration> List<? extends SelectionResult> implicitMembers(DeclarationSelector<D> selector) throws LookupException {
return selector.selection(_implicitMembers);
}