本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}