本文整理汇总了Java中org.apache.commons.collections15.TransformerUtils类的典型用法代码示例。如果您正苦于以下问题:Java TransformerUtils类的具体用法?Java TransformerUtils怎么用?Java TransformerUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransformerUtils类属于org.apache.commons.collections15包,在下文中一共展示了TransformerUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MyGraphMLWriter
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
/**
*
*/
@SuppressWarnings("unchecked")
public MyGraphMLWriter()
{
vertex_ids = new Transformer<V,String>()
{
public String transform(V v)
{
return v.toString();
}
};
edge_ids = TransformerUtils.nullTransformer();
graph_data = Collections.emptyMap();
vertex_data = Collections.emptyMap();
edge_data = Collections.emptyMap();
vertex_desc = TransformerUtils.nullTransformer();
edge_desc = TransformerUtils.nullTransformer();
graph_desc = TransformerUtils.nullTransformer();
nest_level = 0;
}
开发者ID:iTransformers,项目名称:netTransformer,代码行数:23,代码来源:MyGraphMLWriter.java
示例2: GraphMLWriter
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
/**
*
*/
@SuppressWarnings("unchecked")
public GraphMLWriter()
{
vertex_ids = new Transformer<V,String>()
{
public String transform(V v)
{
return v.toString();
}
};
edge_ids = TransformerUtils.nullTransformer();
graph_data = Collections.emptyMap();
vertex_data = Collections.emptyMap();
edge_data = Collections.emptyMap();
vertex_desc = TransformerUtils.nullTransformer();
edge_desc = TransformerUtils.nullTransformer();
graph_desc = TransformerUtils.nullTransformer();
nest_level = 0;
}
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:23,代码来源:GraphMLWriter.java
示例3: inverseEdgeWeights
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
private Transformer<E,Double> inverseEdgeWeights() {
Map<E,Double> ans = new HashMap<E,Double>();
for(E edge: this.nonZeroEdgeWeights.keySet()){
if(nonZeroEdgeWeights.get(edge).doubleValue() > CplexUtil.epsilon){
ans.put(edge, Math.max(1-nonZeroEdgeWeights.get(edge),0));
}
}
return TransformerUtils.switchTransformer(edgeIsNonZero,
TransformerUtils.mapTransformer(ans),
TransformerUtils.constantTransformer(Double.valueOf(1.0)));
}
开发者ID:rma350,项目名称:kidneyExchange,代码行数:12,代码来源:APSPSeparator.java
示例4: APSPPreProcessor
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
public APSPPreProcessor(KepInstance<V, E> kepInstance,
Optional<FixedThreadPool> threadPool) {
this.kepInstance = kepInstance;
System.out.println("Starting all pairs shortest path");
long time = System.currentTimeMillis();
allPairsShortestPath = new ParallelFloydWarshallJung<V, E>(
kepInstance.getGraph(),
TransformerUtils.<Integer> constantTransformer(Integer
.valueOf(1)), threadPool);
allPairsShortestPath.solve();
long elapsed = System.currentTimeMillis() - time;
System.out
.println("Finished all pairs shortest path, elapsed time ms: "
+ elapsed);
minDistToAnyRoot = Maps.newHashMap();
for (V vertex : kepInstance.getGraph().getVertices()) {
if (kepInstance.getRootNodes().contains(vertex)) {
minDistToAnyRoot.put(vertex, 0.0);
} else {
double bestDist = Double.POSITIVE_INFINITY;
for (V root : kepInstance.getRootNodes()) {
bestDist = Math.min(bestDist, allPairsShortestPath
.getShortestPathLength(root, vertex));
}
minDistToAnyRoot.put(vertex, bestDist);
}
}
}
开发者ID:rma350,项目名称:kidneyExchange,代码行数:30,代码来源:APSPPreProcessor.java
示例5: makeEmptyMap
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
public Map makeEmptyMap() {
return TransformedSortedMap.decorate(new TreeMap(), TransformerUtils.nopTransformer(), TransformerUtils.nopTransformer());
}
开发者ID:jgaltidor,项目名称:VarJ,代码行数:4,代码来源:TestTransformedSortedMap.java
示例6: makeEmptyMap
import org.apache.commons.collections15.TransformerUtils; //导入依赖的package包/类
public Map makeEmptyMap() {
return TransformedMap.decorate(new HashMap(), TransformerUtils.nopTransformer(), TransformerUtils.nopTransformer());
}
开发者ID:jgaltidor,项目名称:VarJ,代码行数:4,代码来源:TestTransformedMap.java
注:本文中的org.apache.commons.collections15.TransformerUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论