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


Java LazyMap.decorate方法代码示例

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


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

示例1: initAlgo

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
@Override
public void initAlgo() {
	if (graphModel == null) {
		throw new RuntimeException(
				"The GraphModel for this layout cannot be null!");
	}

	graph = graphModel.getGraphVisible();

	circleNodeDataMap = LazyMap.decorate(
			new HashMap<Node, CircleNodeData>(),
			new Factory<CircleNodeData>() {
				public CircleNodeData create() {
					return new CircleNodeData();
				}
			});

	nodeOrderedList = new ArrayList<Node>();
	for (Node n : graph.getNodes())
		nodeOrderedList.add(n);

	if (LayoutLoader.VERBOSE_LAYOUT)
		Cuttlefish.debug(this, "Layout initialized.");
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:25,代码来源:CircleLayout.java

示例2: MinimumSpanningForest

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
/**
 * Creates a minimum spanning forest from the supplied graph, populating the
 * supplied Forest, which must be empty. 
 * If the supplied root is null, or not present in the Graph,
 * then an arbitrary Graph vertex will be selected as the root.
 * If the Minimum Spanning Tree does not include all vertices of the
 * Graph, then a leftover vertex is selected as a root, and another
 * tree is created
 * @param graph the Graph to find MST in
 * @param forest the Forest to populate. Must be empty
 * @param root first Tree root, may be null
 */
@SuppressWarnings("unchecked")
public MinimumSpanningForest(Graph<V, E> graph, Forest<V,E> forest, 
        V root) {
    
    if(forest.getVertexCount() != 0) {
        throw new IllegalArgumentException("Supplied Forest must be empty");
    }
    this.graph = graph;
    this.forest = forest;
    this.weights = LazyMap.decorate(new HashMap<E,Double>(),
            new ConstantTransformer(1.0));
    Set<E> unfinishedEdges = new HashSet<E>(graph.getEdges());
    if(graph.getVertices().contains(root)) {
        this.forest.addVertex(root);
    }
    updateForest(forest.getVertices(), unfinishedEdges);
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:30,代码来源:MinimumSpanningForest.java

示例3: PersistentLayoutImpl

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
/**
 * create an instance with a passed layout
 * create containers for graph components
 * @param layout 
 */
public PersistentLayoutImpl(Layout<V,E> layout) {
    super(layout);
    this.map = LazyMap.decorate(new HashMap<V,Point>(), new RandomPointFactory(getSize()));

    this.dontmove = new HashSet<V>();
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:12,代码来源:PersistentLayoutImpl.java

示例4: AbstractLayout

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
   protected AbstractLayout(Graph<V,E> graph, Transformer<V,Point2D> initializer) {
	this.graph = graph;
	Transformer<V, ? extends Object> chain = 
		ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
	this.locations = LazyMap.decorate(new HashMap<V,Point2D>(), (Transformer<V,Point2D>)chain);
	initialized = true;
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:9,代码来源:AbstractLayout.java

示例5: setInitializer

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
  public void setInitializer(Transformer<V,Point2D> initializer) {
  	if(this.equals(initializer)) {
  		throw new IllegalArgumentException("Layout cannot be initialized with itself");
  	}
Transformer<V, ? extends Object> chain = 
	ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
  	this.locations = LazyMap.decorate(new HashMap<V,Point2D>(), (Transformer<V, Point2D>)chain);
  	initialized = true;
  }
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:11,代码来源:AbstractLayout.java

示例6: AbstractLayout

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
   protected AbstractLayout(Graph graph, Transformer<Node,Point2D> initializer) {
	this.graph = graph;
	Transformer<Node, ? extends Object> chain = 
		ChainedTransformer.getInstance(initializer, CloneTransformer.getInstance());
	this.locations = LazyMap.decorate(new HashMap<Node,Point2D>(), (Transformer<Node,Point2D>)chain);
	initialized = true;
}
 
开发者ID:andreiolaru-ro,项目名称:AmIciTy-Grph,代码行数:9,代码来源:AbstractLayout.java

示例7: setInitializer

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
public void setInitializer(Transformer<Node,Point2D> initializer) {
	if(this.equals(initializer)) {
		throw new IllegalArgumentException("Layout cannot be initialized with itself");
	}
	this.locations = LazyMap.decorate(new HashMap<Node,Point2D>(), (Transformer<Node, Point2D>)initializer);
	initialized = true;
}
 
开发者ID:andreiolaru-ro,项目名称:AmIciTy-Grph,代码行数:8,代码来源:AbstractLayout.java

示例8: CachingLayout

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
public CachingLayout(Layout<V, E> delegate) {
	super(delegate);
	this.locationMap = LazyMap.<V,Point2D>decorate(new HashMap<V,Point2D>(), 
			new ChainedTransformer<V, Point2D>(new Transformer[]{delegate, CloneTransformer.<Point2D>getInstance()}));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:6,代码来源:CachingLayout.java

示例9: ObservableCachingLayout

import org.apache.commons.collections15.map.LazyMap; //导入方法依赖的package包/类
public ObservableCachingLayout(Layout<V, E> delegate) {
	super(delegate);
	this.locationMap = LazyMap.<V,Point2D>decorate(new HashMap<V,Point2D>(), 
			new ChainedTransformer<V, Point2D>(new Transformer[]{delegate, CloneTransformer.<Point2D>getInstance()}));
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:6,代码来源:ObservableCachingLayout.java


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