Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.collections.functors
Class PrototypeFactory

    java.lang.Object
      org.apache.commons.collections.functors.PrototypeFactory

    public class PrototypeFactory

extends java.lang.Object

Factory implementation that creates a new instance each time based on a prototype.

Since:
  Commons Collections 3.0
Version:
  $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
Author:
  Stephen Colebourne

Method Summary
`static Factory` | `getInstance(java.lang.Object prototype)` Factory method that performs validation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static Factory getInstance(java.lang.Object prototype)

  Factory method that performs validation.

  Creates a Factory that will return a clone of the same prototype object each time the factory is used. The prototype will be cloned using one of these techniques (in order):

  - public clone method
  - public copy constructor
  - serialization clone

  Parameters:
    `prototype` - the object to clone each time in the factory
  Returns:
    the `prototype` factory
  Throws:
    `java.lang.IllegalArgumentException` - if the prototype is null
    `java.lang.IllegalArgumentException` - if the prototype cannot be cloned

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.