Class OutputPin

java.lang.Object
io.zucchini.circuitsimtester.api.BasePin
io.zucchini.circuitsimtester.api.OutputPin

public class OutputPin extends BasePin
Wraps a CircuitSim output Pin component and provides a convenience method for setting its value.
  • Field Summary

    Fields inherited from class io.zucchini.circuitsimtester.api.BasePin

    pin, subcircuit
  • Constructor Summary

    Constructors
    Constructor
    Description
    OutputPin(com.ra4king.circuitsim.simulator.components.wiring.Pin pin, Subcircuit subcircuit)
    Creates a new OutputPin which wraps the provided Pin component and which lives in the provided Subcircuit.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get()
    Returns the current value of this output pin.
    int
    Returns the current value of this output pin sign-extended to 32 bits.

    Methods inherited from class io.zucchini.circuitsimtester.api.BasePin

    getPin, getSubcircuit

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OutputPin

      public OutputPin(com.ra4king.circuitsim.simulator.components.wiring.Pin pin, Subcircuit subcircuit)
      Creates a new OutputPin which wraps the provided Pin component and which lives in the provided Subcircuit.
      Parameters:
      pin - Pin component to wrap
      subcircuit - where this pin lives
      See Also:
  • Method Details

    • get

      public int get()
      Returns the current value of this output pin. Does not sign extend (see getSext() for that).
      Returns:
      value of this pin
      Throws:
      IllegalStateException - If any bit is floating
      See Also:
    • getSext

      public int getSext()
      Returns the current value of this output pin sign-extended to 32 bits.
      Returns:
      value of this pin sign-extended to 32 bits
      Throws:
      IllegalStateException - If any bit is floating
      See Also: