Class Cloner

java.lang.Object
org.opentrafficsim.road.network.factory.xml.utils.Cloner

public final class Cloner
extends Object
Cloner makes a deep clone of any serializable object with serializable fields.

Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Author:
Alexander Verbraeck
  • Method Details

    • clone

      public static <T> T clone​(T object) throws XmlParserException
      Clone an object that is serializable and that has serializable fields.
      Type Parameters:
      T - the type of the object to clone
      Parameters:
      object - the object to clone
      Returns:
      the clone of the object
      Throws:
      XmlParserException - on cloning error
    • cloneRoadLayout

      public static ROADLAYOUT cloneRoadLayout​(BASICROADLAYOUT in)
      Clone the BASICROADLAYOUT, as not all DJUNIT types are serializable...
      Parameters:
      in - the object to clone
      Returns:
      the cloned object