/** * Creates a {@link SnuggleSnapshot} Object holding the current state of this session that can * be later used to recreate a session having exactly the same state. */ public SnuggleSnapshot createSnapshot() { return new SnuggleSnapshot(engine, (SessionConfiguration) configuration.clone(), new ArrayList<InputError>(errors), new HashMap<String, UserDefinedCommand>(userCommandMap), new HashMap<String, UserDefinedEnvironment>(userEnvironmentMap), new ArrayList<FlowToken>(parsedTokens)); }
/** * Creates a {@link SnuggleSnapshot} Object holding the current state of this session that can * be later used to recreate a session having exactly the same state. */ public SnuggleSnapshot createSnapshot() { return new SnuggleSnapshot(engine, (SessionConfiguration) configuration.clone(), new ArrayList<InputError>(errors), new HashMap<String, UserDefinedCommand>(userCommandMap), new HashMap<String, UserDefinedEnvironment>(userEnvironmentMap), new ArrayList<FlowToken>(parsedTokens)); }
/** * Creates a {@link SnuggleSnapshot} Object holding the current state of this session that can * be later used to recreate a session having exactly the same state. */ public SnuggleSnapshot createSnapshot() { return new SnuggleSnapshot(engine, packages, (SessionConfiguration) configuration.clone(), (DOMOutputOptions) defaultDOMOutputOptions.clone(), /* (No real need to clone as this is immutable here, but we'll do it for consistency) */ (XMLStringOutputOptions) defaultXMLStringOutputOptions.clone(), /* (Ditto) */ new ArrayList<InputError>(errors), new HashMap<String, UserDefinedCommand>(userCommandMap), new HashMap<String, UserDefinedEnvironment>(userEnvironmentMap), new ArrayList<FlowToken>(parsedTokens)); }
/** * (This package-private constructor is used when creating a session from an existing * {@link SnuggleSnapshot} via {@link SnuggleSnapshot#createSession()}.) */ SnuggleSession(final SnuggleSnapshot snapshot) { /* Set up main worker Objects */ this.tokeniser = new LaTeXTokeniser(this); this.tokenFixer = new TokenFixer(this); /* Copy stuff from the template */ this.engine = snapshot.engine; this.configuration = (SessionConfiguration) snapshot.configuration.clone(); this.errors = new ArrayList<InputError>(snapshot.errors); this.userCommandMap = new HashMap<String, UserDefinedCommand>(snapshot.userCommandMap); this.userEnvironmentMap = new HashMap<String, UserDefinedEnvironment>(snapshot.userEnvironmentMap); this.parsedTokens = new ArrayList<FlowToken>(snapshot.parsedTokens); }
/** * (This package-private constructor is used when creating a session from an existing * {@link SnuggleSnapshot} via {@link SnuggleSnapshot#createSession()}.) */ SnuggleSession(final SnuggleSnapshot snapshot) { /* Set up main worker Objects */ this.tokeniser = new LaTeXTokeniser(this); this.tokenFixer = new TokenFixer(this); /* Copy stuff from the template */ this.engine = snapshot.engine; this.configuration = (SessionConfiguration) snapshot.configuration.clone(); this.errors = new ArrayList<InputError>(snapshot.errors); this.userCommandMap = new HashMap<String, UserDefinedCommand>(snapshot.userCommandMap); this.userEnvironmentMap = new HashMap<String, UserDefinedEnvironment>(snapshot.userEnvironmentMap); this.parsedTokens = new ArrayList<FlowToken>(snapshot.parsedTokens); }
this.configuration = (SessionConfiguration) configuration.clone();