net.sf.collections15.functors.transformer
Class CloneTransformer<E>

java.lang.Object
  extended by net.sf.collections15.functors.transformer.CloneTransformer<E>
All Implemented Interfaces:
java.io.Serializable, Transformer<E,E>

public class CloneTransformer<E>
extends java.lang.Object
implements Transformer<E,E>, java.io.Serializable

Transformer implementation that returns a clone of the input object.

Clone is performed using the PrototypeFactory class.

Since:
Collections15 1.0
Author:
Stephen Colebourne, Chris Lambrou (port to Java 5.0)
See Also:
Serialized Form

Constructor Summary
protected CloneTransformer()
          Creates a new instance.
 
Method Summary
static
<E> CloneTransformer<E>
getInstance()
          Returns a new CloneTransformer instance.
 E transform(E input)
          Transforms the input object, producing a clone of it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloneTransformer

protected CloneTransformer()
Creates a new instance.

Method Detail

getInstance

public static <E> CloneTransformer<E> getInstance()
Returns a new CloneTransformer instance.

Returns:
A new CloneTransformer instance.
Since:
Collections15 1.0

transform

public E transform(E input)
Transforms the input object, producing a clone of it. The cloning is implemented by PrototypeFactory.getInstance(T).

Specified by:
transform in interface Transformer<E,E>
Parameters:
input - The input object to transform.
Returns:
A clone of the input object.
Throws:
java.lang.IllegalArgumentException - If a Factory cannot be created that is capable of creating a copy of the input object. See the PrototypeFactory class description for details on the methods used to clone the input object.


Copyright © 2001-2005 SourceForge.net. All Rights Reserved.