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


Java IExpressionEvaluator类代码示例

本文整理汇总了Java中org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator的典型用法代码示例。如果您正苦于以下问题:Java IExpressionEvaluator类的具体用法?Java IExpressionEvaluator怎么用?Java IExpressionEvaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IExpressionEvaluator类属于org.eclipse.incquery.runtime.matchers.psystem包,在下文中一共展示了IExpressionEvaluator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_C = body.getOrCreateVariableByName("C");
  	PVariable var_W = body.getOrCreateVariableByName("W");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_C, "C")
  	));
  	new TypeBinary(body, CONTEXT, var_C, var_W, getFeatureLiteral("http://school.ecore", "Course", "weight"), "http://school.ecore/Course.weight");
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern courseWithPrimeWeight";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("W");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.Integer W = (java.lang.Integer) provider.getValue("W");
  			return evaluateExpression_1_1(W);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:41,代码来源:CourseWithPrimeWeightQuerySpecification.java

示例2: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_segment = body.getOrCreateVariableByName("segment");
  	PVariable var_length = body.getOrCreateVariableByName("length");
  	PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_segment, "segment")
  	));
  	new TypeConstraint(body, new FlatTuple(var_segment), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.semanticweb.org/ontologies/2015/ttc/trainbenchmark", "Segment")));
  	new TypeConstraint(body, new FlatTuple(var_segment, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.semanticweb.org/ontologies/2015/ttc/trainbenchmark", "Segment", "length")));
  	new Equality(body, var__virtual_0_, var_length);
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern posLength";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("length");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.Integer length = (java.lang.Integer) provider.getValue("length");
  			return evaluateExpression_1_1(length);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:44,代码来源:PosLengthQuerySpecification.java

示例3: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_parentClass = body.getOrCreateVariableByName("parentClass");
  	PVariable var_methodSignatureTrace = body.getOrCreateVariableByName("methodSignatureTrace");
  	PVariable var_methodSignature = body.getOrCreateVariableByName("methodSignature");
  	PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
  	PVariable var_N = body.getOrCreateVariableByName("N");
  	PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
  	PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
  	PVariable var_M = body.getOrCreateVariableByName("M");
  	PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
  	PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
  	PVariable var_childClass = body.getOrCreateVariableByName("childClass");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_parentClass, "parentClass"),
  				
  		new ExportedParameter(body, var_methodSignatureTrace, "methodSignatureTrace")
  	));
  	new TypeConstraint(body, new FlatTuple(var_parentClass), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("platform:/plugin/TypeGraphBasic/model/TypeGraphBasic.ecore", "TClass")));
  	new TypeConstraint(body, new FlatTuple(var_methodSignatureTrace), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("platform:/plugin/TypeGraphBasic/model/TypeGraphTrace.ecore", "MethodSignatureTrace")));
  	new TypeConstraint(body, new FlatTuple(var_methodSignatureTrace), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("platform:/plugin/TypeGraphBasic/model/TypeGraphTrace.ecore", "MethodSignatureTrace")));
  	new TypeConstraint(body, new FlatTuple(var_methodSignatureTrace, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("platform:/plugin/TypeGraphBasic/model/TypeGraphTrace.ecore", "MethodSignatureTrace", "tMethodSignature")));
  	new Equality(body, var__virtual_0_, var_methodSignature);
  	new PatternMatchCounter(body, new FlatTuple(var_parentClass, var___0_, var_methodSignature), ChildClassesWithSignatureQuerySpecification.instance().getInternalQueryRepresentation(), var__virtual_1_);
  	new Equality(body, var_N, var__virtual_1_);
  	new PatternMatchCounter(body, new FlatTuple(var_parentClass, var___1_), ChildClassesQuerySpecification.instance().getInternalQueryRepresentation(), var__virtual_2_);
  	new Equality(body, var_M, var__virtual_2_);
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern possiblePUM";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("M", "N");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.Integer M = (java.lang.Integer) provider.getValue("M");
  			java.lang.Integer N = (java.lang.Integer) provider.getValue("N");
  			return evaluateExpression_1_1(M, N);
  		}
  
  },  null); 
  	new NegativePatternCall(body, new FlatTuple(var_parentClass, var_methodSignature), ClassWithSignatureQuerySpecification.instance().getInternalQueryRepresentation());
  	new NegativePatternCall(body, new FlatTuple(var_childClass, var_methodSignature), ChildrenClassMethodDefinitionsAccessingSiblingMembersQuerySpecification.instance().getInternalQueryRepresentation());
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:viatra,项目名称:java-refactoring-ttc-viatra,代码行数:63,代码来源:PossiblePUMQuerySpecification.java

示例4: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_S1 = body.getOrCreateVariableByName("S1");
  	PVariable var_S2 = body.getOrCreateVariableByName("S2");
  	PVariable var_N = body.getOrCreateVariableByName("N");
  	PVariable var__Sx1 = body.getOrCreateVariableByName("_Sx1");
  	PVariable var_M = body.getOrCreateVariableByName("M");
  	PVariable var__Sx2 = body.getOrCreateVariableByName("_Sx2");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_S1, "S1"),
  				
  		new ExportedParameter(body, var_S2, "S2")
  	));
  	new TypeUnary(body, var_S1, getClassifierLiteral("http://school.ecore", "Student"), "http://school.ecore/Student");
  	new TypeUnary(body, var_S2, getClassifierLiteral("http://school.ecore", "Student"), "http://school.ecore/Student");
  	new PatternMatchCounter(body, new FlatTuple(var_S1, var__Sx1), InTheCircleOfFriendsQuerySpecification.instance().getInternalQueryRepresentation(), var_N);
  	new PatternMatchCounter(body, new FlatTuple(var_S2, var__Sx2), InTheCircleOfFriendsQuerySpecification.instance().getInternalQueryRepresentation(), var_M);
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern moreFriendsThan";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("M", "N");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.Integer M = (java.lang.Integer) provider.getValue("M");
  			java.lang.Integer N = (java.lang.Integer) provider.getValue("N");
  			return evaluateExpression_1_1(M, N);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	{
  	PAnnotation annotation = new PAnnotation("QueryExplorer");
  	annotation.addAttribute("display", false);
  	addAnnotation(annotation);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:56,代码来源:MoreFriendsThanQuerySpecification.java

示例5: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_C = body.getOrCreateVariableByName("C");
  	PVariable var_CName = body.getOrCreateVariableByName("CName");
  	PVariable var_W = body.getOrCreateVariableByName("W");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_C, "C")
  	));
  	new TypeBinary(body, CONTEXT, var_C, var_CName, getFeatureLiteral("http://school.ecore", "Course", "subject"), "http://school.ecore/Course.subject");
  	new TypeBinary(body, CONTEXT, var_C, var_W, getFeatureLiteral("http://school.ecore", "Course", "weight"), "http://school.ecore/Course.weight");
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern courseWithNameLongerThanWeight";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("CName", "W");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.String CName = (java.lang.String) provider.getValue("CName");
  			java.lang.Integer W = (java.lang.Integer) provider.getValue("W");
  			return evaluateExpression_1_1(CName, W);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:44,代码来源:CourseWithNameLongerThanWeightQuerySpecification.java

示例6: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_T1 = body.getOrCreateVariableByName("T1");
  	PVariable var_T2 = body.getOrCreateVariableByName("T2");
  	PVariable var_N = body.getOrCreateVariableByName("N");
  	PVariable var__SC1 = body.getOrCreateVariableByName("_SC1");
  	PVariable var_M = body.getOrCreateVariableByName("M");
  	PVariable var__SC2 = body.getOrCreateVariableByName("_SC2");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_T1, "T1"),
  				
  		new ExportedParameter(body, var_T2, "T2")
  	));
  	new TypeUnary(body, var_T1, getClassifierLiteral("http://school.ecore", "Teacher"), "http://school.ecore/Teacher");
  	new TypeUnary(body, var_T2, getClassifierLiteral("http://school.ecore", "Teacher"), "http://school.ecore/Teacher");
  	new PatternMatchCounter(body, new FlatTuple(var_T1, var__SC1), ClassesOfTeacherQuerySpecification.instance().getInternalQueryRepresentation(), var_N);
  	new PatternMatchCounter(body, new FlatTuple(var_T2, var__SC2), ClassesOfTeacherQuerySpecification.instance().getInternalQueryRepresentation(), var_M);
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern teachesMoreClasses";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("M", "N");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.Integer M = (java.lang.Integer) provider.getValue("M");
  			java.lang.Integer N = (java.lang.Integer) provider.getValue("N");
  			return evaluateExpression_1_1(M, N);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	{
  	PAnnotation annotation = new PAnnotation("QueryExplorer");
  	annotation.addAttribute("display", false);
  	addAnnotation(annotation);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:56,代码来源:TeachesMoreClassesQuerySpecification.java

示例7: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_W = body.getOrCreateVariableByName("W");
  	PVariable var_C = body.getOrCreateVariableByName("C");
  	PVariable var_CName = body.getOrCreateVariableByName("CName");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_W, "W")
  	));
  	new TypeBinary(body, CONTEXT, var_C, var_CName, getFeatureLiteral("http://school.ecore", "Course", "subject"), "http://school.ecore/Course.subject");
  	new TypeBinary(body, CONTEXT, var_C, var_W, getFeatureLiteral("http://school.ecore", "Course", "weight"), "http://school.ecore/Course.weight");
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern courseWithNameLongerThanWeightInt";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("CName", "W");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.String CName = (java.lang.String) provider.getValue("CName");
  			java.lang.Integer W = (java.lang.Integer) provider.getValue("W");
  			return evaluateExpression_1_1(CName, W);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:44,代码来源:CourseWithNameLongerThanWeightIntQuerySpecification.java

示例8: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
public Set<PBody> doGetContainedBodies() throws QueryInitializationException {
  Set<PBody> bodies = Sets.newLinkedHashSet();
  try {
  {
  	PBody body = new PBody(this);
  	PVariable var_S = body.getOrCreateVariableByName("S");
  	PVariable var_s_id = body.getOrCreateVariableByName("s_id");
  	PVariable var_WTC = body.getOrCreateVariableByName("WTC");
  	PVariable var_c_id = body.getOrCreateVariableByName("c_id");
  	body.setExportedParameters(Arrays.<ExportedParameter>asList(
  		new ExportedParameter(body, var_S, "S"),
  				
  		new ExportedParameter(body, var_s_id, "s_id"),
  				
  		new ExportedParameter(body, var_WTC, "WTC"),
  				
  		new ExportedParameter(body, var_c_id, "c_id")
  	));
  	new TypeUnary(body, var_WTC, getClassifierLiteral("http://WTSpec/2.0", "CtrlUnit99"), "http://WTSpec/2.0/CtrlUnit99");
  	new TypeBinary(body, CONTEXT, var_S, var_WTC, getFeatureLiteral("http://WTSpec/2.0", "Subsystem", "itsWTCs"), "http://WTSpec/2.0/Subsystem.itsWTCs");
  	new TypeBinary(body, CONTEXT, var_S, var_s_id, getFeatureLiteral("http://WTSpec/2.0", "Subsystem", "sysId"), "http://WTSpec/2.0/Subsystem.sysId");
  	new TypeBinary(body, CONTEXT, var_WTC, var_c_id, getFeatureLiteral("http://WTSpec/2.0", "wtc", "sysId"), "http://WTSpec/2.0/wtc.sysId");
  new ExpressionEvaluation(body, new IExpressionEvaluator() {
  	
  	@Override
  	public String getShortDescription() {
  		return "Expression evaluation from pattern subSystemGenerator_CtrUnit99";
  	}
  
  	@Override
  	public Iterable<String> getInputParameterNames() {
  		return Arrays.asList("s_id");
  	}
  
  	@Override
  	public Object evaluateExpression(IValueProvider provider) throws Exception {
  			java.lang.String s_id = (java.lang.String) provider.getValue("s_id");
  			return evaluateExpression_1_1(s_id);
  		}
  
  },  null); 
  	bodies.add(body);
  }
  	// to silence compiler error
  	if (false) throw new IncQueryException("Never", "happens");
  } catch (IncQueryException ex) {
  	throw processDependencyException(ex);
  }
  return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:52,代码来源:SubSystemGenerator_CtrUnit99QuerySpecification.java

示例9: doGetContainedBodies

import org.eclipse.incquery.runtime.matchers.psystem.IExpressionEvaluator; //导入依赖的package包/类
@Override
protected Set<PBody> doGetContainedBodies() throws QueryInitializationException {
	Set<PBody> bodies = Sets.newLinkedHashSet();
	{
		PBody body = new PBody(this);
		bodies.add(body);
		
		PVariable var_gold = body.getOrCreateVariableByName("goldObject");
		PVariable var_front = body.getOrCreateVariableByName("frontObject");
		PVariable var_eClass = body.getOrCreateVariableByName("eClass");
		body.setExportedParameters(Arrays.<ExportedParameter>asList(
				new ExportedParameter(body, var_gold, "goldObject"),
				new ExportedParameter(body, var_front, "frontObject"),
	      		new ExportedParameter(body, var_eClass, "eClass")
				));
		PVariable var_role = body.getOrCreateVariableByName("role");
		PVariable var_judgement = body.getOrCreateVariableByName("judgement");
	
		new TypeConstraint(body, new FlatTuple(var_gold, var_eClass), 
		        new CollabLensModelInputKey(EOBJECT_KEY, GOLD));
		new TypeConstraint(body, new FlatTuple(var_front, var_eClass), 
		        new CollabLensModelInputKey(EOBJECT_KEY, FRONT));
		new TypeConstraint(body, new FlatTuple(var_gold, var_front), 
				CorrespondenceKey.EOBJECT);
		
		new TypeConstraint(body, new FlatTuple(var_gold, var_role, var_judgement), 
				new SecurityJudgementKey(OperationKind.READ, ObjectAsset.class));
		new ConstantValue(body, var_judgement, RuleType.PERMIT);
		new ExpressionEvaluation(body, new IExpressionEvaluator() {
			@Override
			public String getShortDescription() {
				return "role is bob";
			}
			
			@Override
			public Iterable<String> getInputParameterNames() {
				return Collections.singleton("role");
			}
			@Override
			public Object evaluateExpression(IValueProvider provider) throws Exception {
				final Role role = (Role) provider.getValue("role");
				return "bob".equals(role.getName());
			}
		}, null);
	}
	return bodies;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:48,代码来源:LensQueryTestHandler.java


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