Package net.fortytwo.ripple.model

Source Code of net.fortytwo.ripple.model.StackContext

package net.fortytwo.ripple.model;

import net.fortytwo.ripple.RippleException;

/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class StackContext implements Cloneable {
    protected final ModelConnection modelConnection;

    protected RippleList stack;

    public StackContext(final RippleList stack, final ModelConnection mc) {
        this.stack = stack;
        this.modelConnection = mc;
    }

    public RippleList getStack() {
        return this.stack;
    }

    public ModelConnection getModelConnection() {
        return this.modelConnection;
    }

    public StackContext with(final RippleList s) {
        try {
            StackContext clone = (StackContext) this.clone();
            clone.stack = s;
            return clone;
        }

        // This shouldn't happen.
        catch (CloneNotSupportedException e) {
            new RippleException(e).logError();
            return this;
        }
    }
}
TOP

Related Classes of net.fortytwo.ripple.model.StackContext

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.