org.vfny.geoserver.global.dto
Class CloneLibrary

java.lang.Object
  extended byorg.vfny.geoserver.global.dto.CloneLibrary

public final class CloneLibrary
extends java.lang.Object

CloneLibrary purpose is used to try and Set up a Deep Copy for DTO objets.

Static Library class for cloning complex structures independant of their contents.

Jody here - this is much more accessable when presented to the user as new Type( Type ) idiom. Java clone is messed up, I have seen several projects move to a copy() method or the above idom.

For the here and now we can use the above Idom. This will even work with all of our lists and Maps since we are only ever using Strings (imutable) in them.


Constructor Summary
CloneLibrary()
           
 
Method Summary
static com.vividsolutions.jts.geom.Envelope clone(com.vividsolutions.jts.geom.Envelope e)
          clone purpose.
static java.util.List clone(java.util.List source)
          clone purpose.
static java.util.Map clone(java.util.Map source)
          clone purpose.
static java.lang.String[] clone(java.lang.String[] array)
          Clone a string array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloneLibrary

public CloneLibrary()
Method Detail

clone

public static java.util.List clone(java.util.List source)
                            throws java.lang.CloneNotSupportedException
clone purpose.

Clones a List so that it matches the requirements that the returned object would be equal to the source.

Parameters:
source - The list to be cloned.
Returns:
An exact clone of the list.
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone(), List

clone

public static java.util.Map clone(java.util.Map source)
                           throws java.lang.CloneNotSupportedException
clone purpose.

Clones a Map so that it matches the requirements that the returned object would be equal to the source.

Parameters:
source - The Map to be cloned.
Returns:
An exact clone of the list.
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone(), Map

clone

public static com.vividsolutions.jts.geom.Envelope clone(com.vividsolutions.jts.geom.Envelope e)
clone purpose.

Clones a Envelope so that it matches the requirements that the returned object would be equal to the source.

Parameters:
e - The Envelope to be cloned.
Returns:
An exact clone of the list.
See Also:
Object.clone(), Envelope

clone

public static java.lang.String[] clone(java.lang.String[] array)
Clone a string array

Parameters:
array - DOCUMENT ME!
Returns:
DOCUMENT ME!