Example usage for org.apache.commons.collections15.functors CloneTransformer getInstance

List of usage examples for org.apache.commons.collections15.functors CloneTransformer getInstance

Introduction

In this page you can find the example usage for org.apache.commons.collections15.functors CloneTransformer getInstance.

Prototype

public static <T> Transformer<T, T> getInstance() 

Source Link

Document

Factory returning the singleton instance.

Usage

From source file:edu.uci.ics.jung.algorithms.layout.AbstractLayout.java

@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;/* www .j av a2s .co m*/
}

From source file:edu.uci.ics.jung.algorithms.layout.AbstractLayout.java

@SuppressWarnings("unchecked")
protected AbstractLayout(Graph<V, E> graph, Transformer<V, Point2D> initializer, Dimension size) {
    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);
    this.size = size;
}

From source file:edu.uci.ics.jung.algorithms.layout.AbstractLayout.java

@SuppressWarnings("unchecked")
public void setInitializer(Transformer<V, Point2D> initializer) {
    if (this.equals(initializer)) {
        throw new IllegalArgumentException("Layout cannot be initialized with itself");
    }/*from  www.  j ava 2  s. c o m*/
    Transformer<V, ? extends Object> chain = ChainedTransformer.getInstance(initializer,
            CloneTransformer.getInstance());
    this.locations = LazyMap.decorate(new HashMap<V, Point2D>(), (Transformer<V, Point2D>) chain);
    initialized = true;
}