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


Java Tuple类代码示例

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


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

示例1: assertTuple

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
public Tuple assertTuple(Tuple seed) {
	final URI relativeURI = (URI) seed.get(1);
	if (relativeURI == null) 
		throw new IllegalArgumentException(seed.toString());
	URI resourceURI = model.getUriRelativiser().relativePathToURI(relativeURI);
	
	Resource resource = (Resource) seed.get(0);
	if (resource != null) // rolling back model fact deletion
		try {
			resource.load(null);
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	else // loading new resource 
		resource = EMFUtil.getOrCreateResource(root, resourceURI);
	
	return new FlatTuple(resource, relativeURI);
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:20,代码来源:ResourceManipulator.java

示例2: retractTuple

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
public Tuple retractTuple(Tuple tuple) {
	final EObject element = (EObject) tuple.get(0);
	final EReference feature = (EReference) tuple.get(1);
	final EObject value = (EObject) tuple.get(2);
	if (element == null || feature == null || value == null) 
		throw new UnsupportedOperationException(tuple.toString());
	
	if (feature.isContainment()) {
		unroot(tuple, value, feature, element);
	} else if (feature.isContainer()) {
		unroot(tuple, element, feature.getEOpposite(), value);
	} else {
		EObjectAttributeManipulator.retractFeatureSetting(element, feature, value);
	}
	return tuple;
	
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:19,代码来源:EObjectReferenceManipulator.java

示例3: assertTuple

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
public Tuple assertTuple(Tuple seed) {
	final EObject element = (EObject) seed.get(0);
	final EReference feature = (EReference) seed.get(1);
	final EObject value = (EObject) seed.get(2);
	if (element == null || feature == null || value == null) 
		throw new UnsupportedOperationException(seed.toString());
	
	if (feature.isContainment()) {
		move(seed, element, feature, value);
	} else if (feature.isContainer()) {
		move(seed, value, feature.getEOpposite(), element);
	} else {
		EObjectAttributeManipulator.assertFeatureSetting(element, feature, value);
	}
	return seed;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:18,代码来源:EObjectReferenceManipulator.java

示例4: doTest

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected void doTest(MondoLensScope scope, IFile policyFile, IFile goldFile, IFile frontFile,
		Resource policyResource, Resource goldResource, Resource frontResource) {
	MondoLensRuntimeContext runtimeContext = MondoLensRuntimeContext.create(null, scope);
	
	for (IInputKey key : runtimeContext.getInputKeys()) {
		System.out.println();
		System.out.println("-----------------");
		System.out.println("Tuples of key: " + key.getPrettyPrintableName());
		
		final FlatTuple nullSeed = new FlatTuple(new Object[key.getArity()]);
		for (Tuple tuple : runtimeContext.enumerateTuples(key, nullSeed)) {
			System.out.println("\t" + tuple);
		}
	}
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:17,代码来源:LensContextTestHandler.java

示例5: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected DefinedByMatch tupleToMatch(final Tuple t) {
  try {
  	return DefinedByMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE), (hu.bme.mit.trainbenchmark.ttc.railway.Sensor) t.get(POSITION_SENSOR));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:DefinedByMatcher.java

示例6: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected EntrySemaphoreMatch tupleToMatch(final Tuple t) {
  try {
  	return EntrySemaphoreMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE), (hu.bme.mit.trainbenchmark.ttc.railway.Semaphore) t.get(POSITION_SEMAPHORE));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:EntrySemaphoreMatcher.java

示例7: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected HasSensorMatch tupleToMatch(final Tuple t) {
  try {
  	return HasSensorMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.TrackElement) t.get(POSITION_SW));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:HasSensorMatcher.java

示例8: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected RouteSensorMatch tupleToMatch(final Tuple t) {
  try {
  	return RouteSensorMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE), (hu.bme.mit.trainbenchmark.ttc.railway.Sensor) t.get(POSITION_SENSOR), (hu.bme.mit.trainbenchmark.ttc.railway.SwitchPosition) t.get(POSITION_SWITCHPOSITION), (hu.bme.mit.trainbenchmark.ttc.railway.Switch) t.get(POSITION_SW));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:RouteSensorMatcher.java

示例9: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected SemaphoreNeighborMatch tupleToMatch(final Tuple t) {
  try {
  	return SemaphoreNeighborMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Semaphore) t.get(POSITION_SEMAPHORE), (hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE1), (hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE2), (hu.bme.mit.trainbenchmark.ttc.railway.Sensor) t.get(POSITION_SENSOR1), (hu.bme.mit.trainbenchmark.ttc.railway.Sensor) t.get(POSITION_SENSOR2), (hu.bme.mit.trainbenchmark.ttc.railway.TrackElement) t.get(POSITION_TE1), (hu.bme.mit.trainbenchmark.ttc.railway.TrackElement) t.get(POSITION_TE2));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:SemaphoreNeighborMatcher.java

示例10: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected SwitchSetMatch tupleToMatch(final Tuple t) {
  try {
  	return SwitchSetMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Semaphore) t.get(POSITION_SEMAPHORE), (hu.bme.mit.trainbenchmark.ttc.railway.Route) t.get(POSITION_ROUTE), (hu.bme.mit.trainbenchmark.ttc.railway.SwitchPosition) t.get(POSITION_SWP), (hu.bme.mit.trainbenchmark.ttc.railway.Switch) t.get(POSITION_SW));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:SwitchSetMatcher.java

示例11: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected SwitchSensorMatch tupleToMatch(final Tuple t) {
  try {
  	return SwitchSensorMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Switch) t.get(POSITION_SW));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:SwitchSensorMatcher.java

示例12: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected PosLengthMatch tupleToMatch(final Tuple t) {
  try {
  	return PosLengthMatch.newMatch((hu.bme.mit.trainbenchmark.ttc.railway.Segment) t.get(POSITION_SEGMENT));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:FTSRG,项目名称:trainbenchmark-ttc,代码行数:10,代码来源:PosLengthMatcher.java

示例13: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected Id2objectMatch tupleToMatch(final Tuple t) {
  try {
  	return Id2objectMatch.newMatch((es.ikerlan.WTSpec4M.WTElement) t.get(POSITION_EOBJECT), (java.lang.String) t.get(POSITION_ID));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:10,代码来源:Id2objectMatcher.java

示例14: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected ChildClassesWithDifferentParentsMatch tupleToMatch(final Tuple t) {
  try {
  	return ChildClassesWithDifferentParentsMatch.newMatch((TypeGraphTrace.ClassListTrace) t.get(POSITION_CLASSLISTTRACE), (TypeGraphBasic.TClass) t.get(POSITION_CLASSONE), (TypeGraphBasic.TClass) t.get(POSITION_CLASSTWO));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:viatra,项目名称:java-refactoring-ttc-viatra,代码行数:10,代码来源:ChildClassesWithDifferentParentsMatcher.java

示例15: tupleToMatch

import org.eclipse.incquery.runtime.matchers.tuple.Tuple; //导入依赖的package包/类
@Override
protected MethodDefinitionInClassListMatch tupleToMatch(final Tuple t) {
  try {
  	return MethodDefinitionInClassListMatch.newMatch((TypeGraphBasic.TClass) t.get(POSITION_PARENTCLASS), (TypeGraphBasic.TMethodSignature) t.get(POSITION_METHODSIGNATURE), (TypeGraphBasic.TClass) t.get(POSITION_CLAZZ), (TypeGraphBasic.TMethodDefinition) t.get(POSITION_METHODDEFINITION));
  } catch(ClassCastException e) {
  	LOGGER.error("Element(s) in tuple not properly typed!",e);
  	return null;
  }
}
 
开发者ID:viatra,项目名称:java-refactoring-ttc-viatra,代码行数:10,代码来源:MethodDefinitionInClassListMatcher.java


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