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