Package org.nlogo.sdm.gui

Source Code of org.nlogo.sdm.gui.WrappedStock

// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo

package org.nlogo.sdm.gui;

import org.nlogo.sdm.Stock;

public strictfp class WrappedStock
    implements org.jhotdraw.util.Storable {
  final Stock stock;

  public WrappedStock() {
    stock = new Stock();
  }

  public WrappedStock(Stock stock) {
    this.stock = stock;
  }

  public void write(org.jhotdraw.util.StorableOutput dw) {
    dw.writeString(stock.getName());
    dw.writeString(stock.getInitialValueExpression());
    dw.writeBoolean(stock.isNonNegative());
  }

  public void read(org.jhotdraw.util.StorableInput dr)
      throws java.io.IOException {
    stock.setName(dr.readString());
    stock.setInitialValueExpression(dr.readString());
    stock.setNonNegative(dr.readBoolean());
  }

}
TOP

Related Classes of org.nlogo.sdm.gui.WrappedStock

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.