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


Java IValueFactory.mapWriter方法代码示例

本文整理汇总了Java中org.eclipse.imp.pdb.facts.IValueFactory.mapWriter方法的典型用法代码示例。如果您正苦于以下问题:Java IValueFactory.mapWriter方法的具体用法?Java IValueFactory.mapWriter怎么用?Java IValueFactory.mapWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.imp.pdb.facts.IValueFactory的用法示例。


在下文中一共展示了IValueFactory.mapWriter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compose

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
public static IMap compose(IValueFactory vf, IMap map1, IMap map2) {
	Type newMapType;

	if (map1.getType().hasFieldNames() && map2.getType().hasFieldNames()) {
		newMapType = TypeFactory.getInstance().mapType(
				map1.getType().getKeyType(), map1.getType().getKeyLabel(),
				map2.getType().getValueType(),
				map2.getType().getValueLabel());
	} else {
		newMapType = TypeFactory.getInstance().mapType(map1.getKeyType(),
				map2.getValueType());
	}

	IMapWriter w = vf.mapWriter(newMapType);

	Iterator<Entry<IValue, IValue>> iter = map1.entryIterator();
	while (iter.hasNext()) {
		Entry<IValue, IValue> e = iter.next();
		IValue value = map2.get(e.getValue());
		if (value != null) {
			w.put(e.getKey(), value);
		}
	}

	return w.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:27,代码来源:MapFunctions.java

示例2: immutableSetOfMapsToSetOfMapValues

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
private static ISet immutableSetOfMapsToSetOfMapValues(
				ImmutableSet<ImmutableMap<IConstructor, ImmutableSet<IConstructor>>> result) {
	// convert back to PDB for serialization
	IValueFactory vf = org.eclipse.imp.pdb.facts.impl.persistent.ValueFactory.getInstance();

	ISetWriter resultBuilder = vf.setWriter();

	for (ImmutableMap<IConstructor, ImmutableSet<IConstructor>> dominatorResult : result) {
		IMapWriter builder = vf.mapWriter();

		for (Map.Entry<IConstructor, ImmutableSet<IConstructor>> entry : dominatorResult
						.entrySet()) {
			builder.put(entry.getKey(), immutableSetToPdbSet(entry.getValue()));
		}

		resultBuilder.insert(builder.done());
	}

	return resultBuilder.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:21,代码来源:DominatorsChamp_LazyHashCode.java

示例3: common

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
public static IMap common(IValueFactory vf, IMap map1, IMap map2) {
	IMapWriter sw = vf.mapWriter(map1.getType().lub(map2.getType()));

	for (IValue key : map1) {
		IValue thisValue = map1.get(key);
		IValue otherValue = map2.get(key);
		if (otherValue != null && thisValue.isEqual(otherValue)) {
			sw.put(key, thisValue);
		}
	}
	return sw.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:13,代码来源:MapFunctions.java

示例4: remove

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
public static IMap remove(IValueFactory vf, IMap map1, IMap map2) {
	IMapWriter sw = vf.mapWriter(map1.getType());
	for (IValue key : map1) {
		if (!map2.containsKey(key)) {
			sw.put(key, map1.get(key));
		}
	}
	return sw.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:10,代码来源:MapFunctions.java

示例5: immutableMapToPdbMap

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
private static IMap immutableMapToPdbMap(
				ImmutableMap<IConstructor, ImmutableSet<IConstructor>> result) {
	// convert back to PDB for serialization
	IValueFactory vf = org.eclipse.imp.pdb.facts.impl.persistent.ValueFactory.getInstance();

	IMapWriter builder = vf.mapWriter();

	for (Map.Entry<IConstructor, ImmutableSet<IConstructor>> entry : result.entrySet()) {
		builder.put(entry.getKey(), immutableSetToPdbSet(entry.getValue()));
	}

	return builder.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:14,代码来源:DominatorsChamp_LazyHashCode.java

示例6: put

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
public static IMap put(IValueFactory vf, IMap map1, IValue key, IValue value) {
	IMapWriter sw = vf.mapWriter(map1.getType());
	sw.putAll(map1);
	sw.put(key, value);
	return sw.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:7,代码来源:MapFunctions.java

示例7: join

import org.eclipse.imp.pdb.facts.IValueFactory; //导入方法依赖的package包/类
public static IMap join(IValueFactory vf, IMap map1, IMap map2) {
	IMapWriter sw = vf.mapWriter(map1.getType().lub(map2.getType()));
	sw.putAll(map1);
	sw.putAll(map2);
	return sw.done();
}
 
开发者ID:msteindorfer,项目名称:oopsla15-artifact,代码行数:7,代码来源:MapFunctions.java


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