Class TraversedObjectsContext

  • Direct Known Subclasses:
    SCloner.CloneContext

    public class TraversedObjectsContext
    extends java.lang.Object
    Standard context for Traverser, keeps track of already traversed objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.Object,​java.lang.Object> traversed
      Map of traversed objects
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.Object input)
      Gets an output object of a traversed object.
      void put​(java.lang.Object input, java.lang.Object output)
      Adds an the input and output of a traversed object.
      static void put​(java.lang.Object context, java.lang.Object input, java.lang.Object output)
      Adds an the input and output of a traversed object if context is a TraversedObjectContext.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • traversed

        protected java.util.Map<java.lang.Object,​java.lang.Object> traversed
        Map of traversed objects
    • Constructor Detail

      • TraversedObjectsContext

        public TraversedObjectsContext()
        Creates the context.
    • Method Detail

      • put

        public void put​(java.lang.Object input,
                        java.lang.Object output)
        Adds an the input and output of a traversed object.
        Parameters:
        input - The input object.
        output - The output object.
      • get

        public java.lang.Object get​(java.lang.Object input)
        Gets an output object of a traversed object.
        Parameters:
        input - The input object.
        Returns:
        The output object.
      • put

        public static final void put​(java.lang.Object context,
                                     java.lang.Object input,
                                     java.lang.Object output)
        Adds an the input and output of a traversed object if context is a TraversedObjectContext.
        Parameters:
        context - The context.
        input - The input object.
        output - The output object.