Class Cloner


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

    Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.

    Author:
    Alexander Verbraeck
    • Method Detail

      • 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