/** * Creates a stack from another stack (starting at the next of the given * callstack) This does a deep copy of the stack. */ public CallStack(final CallStack stackToCopy) { name = stackToCopy.name; for (final Iterator<Call> i = stackToCopy.iterator(); i.hasNext();) { final Call callToCopy = i.next(); elements.add((Call) callToCopy.clone()); } this.statistics = stackToCopy.statistics; this.metric = stackToCopy.metric; }