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


Java SelectionResult类代码示例

本文整理汇总了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;
	}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:21,代码来源:SingleStaticImport.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:24,代码来源:Subobject.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:8,代码来源:JavaNonNestedPackageLookupStrategy.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:13,代码来源:JavaTypeInstantiation.java

示例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();
			}
			
		};
	}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:37,代码来源:SingleStaticImport.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:11,代码来源:ComponentSubtypeRelation.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:12,代码来源:SubobjectConstructorCall.java

示例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());
    }
  };
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:10,代码来源:SubobjectConstructorCall.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:9,代码来源:JLoSubtypeRelation.java

示例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);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:6,代码来源:AbstractJavaMethodSelector.java

示例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));
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:4,代码来源:NamelessConstructorSelector.java

示例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());
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:6,代码来源:ConstructorSelector.java

示例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);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:7,代码来源:BasicMethodSelectionResult.java

示例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());
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:4,代码来源:ConstructorInvocation.java

示例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);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:5,代码来源:RawType.java


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