org.apache.commons.collections15.Transformer.transform()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.apache.commons.collections15.Transformer.transform()方法的一些代码示例,展示了Transformer.transform()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transformer.transform()方法的具体详情如下:
包路径:org.apache.commons.collections15.Transformer
类名称:Transformer
方法名:transform

Transformer.transform介绍

[英]Transforms the input object (leaving it unchanged) into some output object.
[中]将输入对象(保持不变)转换为某个输出对象。

代码示例

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
 * Returns the prior probability for <code>v</code>.
 * @param v the vertex whose prior probability is being queried
 * @return the prior probability for <code>v</code>
 */
protected S getVertexPrior(V v)
{
  return vertex_priors.transform(v);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Returns the prior probability for <code>v</code>.
 * 
 * @param v
 *            the vertex whose prior probability is being queried
 * @return the prior probability for <code>v</code>
 */
protected S getVertexPrior(V v) {
  return vertex_priors.transform(v);
}

代码示例来源:origin: org.opendaylight.nic/of-renderer

private double calculatePathCost(final List<E> path){
    double result = 0;
    for(E edge : path) {
      result += defaultEdgeWeight.transform(edge).doubleValue();
    }
    return result;
  }
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

@Override
  public Integer transform(ONDEXConcept arg0) {
    if (entitiesSizes.containsKey(arg0))
      return entitiesSizes.get(arg0);
    return oldSizes.transform(arg0);
  }
};

代码示例来源:origin: org.apache.batchee/batchee-maven-plugin

private Rectangle getBound(final Node n, final Transformer<Node, Shape> vst) {
  if (vst == null) {
    return new Rectangle(0, 0);
  }
  return vst.transform(n).getBounds();
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

@Override
  public Integer transform(ONDEXRelation arg0) {
    if (entitiesSizes.containsKey(arg0))
      return entitiesSizes.get(arg0);
    if (oldSizes != null)
      return oldSizes.transform(arg0);
    return Config.defaultEdgeSize;
  }
};

代码示例来源:origin: geogebra/geogebra

@Override
@SuppressWarnings("unchecked")
public V get(Object key) {
  // create value for key if key is not currently in the map
  if (map.containsKey(key) == false) {
    V value = this.transformer.transform((K) key);
    map.put((K) key, value);
    return value;
  }
  return map.get(key);
}

代码示例来源:origin: girtel/Net2Plan

@Override
  public Point2D transform(V input)
  {
    Point2D p = new Point2D.Double();
    p.setLocation(vertexPositionTransformer.transform(input));
    p.setLocation(p.getX(), -p.getY());
    return p;
  }
};

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
 * @see Transformer#transform(Object)
 */
public Number transform(VEPair<V,E> arg0)
{
  return delegate.transform(arg0.getE());
}

代码示例来源:origin: iTransformers/netTransformer

public String transform(String s) {
    final Transformer<String, String> transformer = createTransformer();
    if (transformer == null) return null;
    return transformer.transform(s);
  }
};

代码示例来源:origin: iTransformers/netTransformer

public String transform(String s)  {
    final Transformer<String, String> transformer = createTransformer();
    if (transformer == null) return "";
    return transformer.transform(s);
  }
};

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
 * Gets the edge weight for <code>e</code> in the context of its (incident) vertex <code>v</code>.
 * @param v the vertex incident to e as a context in which the edge weight is to be calculated
 * @param e the edge whose weight is to be returned
 * @return the edge weight for <code>e</code> in the context of its (incident) vertex <code>v</code>
 */
protected Number getEdgeWeight(V v, E e)
{
  return edge_weights.transform(new VEPair<V,E>(v,e));
}

代码示例来源:origin: SmartDataAnalytics/Sparqlify

@Override
public V put(K key, V value) {
  K normKey = keyNormalizer.transform(key);

  //if(origToNorm.inverseBidiMap().get(normKey)
  
  
  origToNorm.put(key, normKey);
  map.put(normKey, value);
  
  return value;
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see Transformer#transform(Object)
 */
@Override
public Number transform(VEPair<V, E> arg0) {
  return delegate.transform(arg0.getE());
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Returns a <code>Rectangle2D</code> whose width and height are defined by
 * this instance's size and aspect ratio functions for this vertex.
 */
public Rectangle2D getRectangle(V v) {
  float width = vsf.transform(v);
  float height = width * varf.transform(v);
  float h_offset = -(width / 2);
  float v_offset = -(height / 2);
  theRectangle.setFrame(h_offset, v_offset, width, height);
  return (Rectangle2D) theRectangle.clone();
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * The super class retrieves the start color.
 */
protected Color getColor1(Object e)
{
  return vv.getPickedEdgeState().isPicked(e) ? (Color)defaultTransformer.transform(e) : Color.WHITE;
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * The super class retrieves the end color.
 */
protected Color getColor2(Object e)
{
  return vv.getPickedEdgeState().isPicked(e) ? Color.WHITE : (Color)defaultTransformer.transform(e);
}

代码示例来源:origin: girtel/Net2Plan

@Override
  public Double transform(Link edge)
  {
    if (graph.containsEdge(edge))
    {
      if (edge.getId() < 0) throw new RuntimeException("Bad");
      return nev.transform(edge);
    } else if (auxGraph.containsEdge(edge)) { return 1.0; }
    throw new RuntimeException("Bad");
  }
};

代码示例来源:origin: org.pitest/highwheel-core

public Component prepareRenderer(
  final RenderContext<ElementName, Dependency> rc,
  final VertexLabelRenderer graphLabelRenderer, final Object value,
  final boolean isSelected, final ElementName vertex) {
 return rc.getVertexLabelRenderer()
   .<ElementName> getVertexLabelRendererComponent(rc.getScreenDevice(),
     value, rc.getVertexFontTransformer().transform(vertex), isSelected,
     vertex);
}

代码示例来源:origin: girtel/Net2Plan

@Override
public void updateNodesXYPosition()
{
  for (GUINode vertex : canvas.getAllVertices())
    canvas.getLayout().setLocation(vertex, canvas.getTransformer().transform(vertex));
}

相关文章

Transformer类方法