Package edu.gatech.cs2110.circuitsim.api
Class OutputPin
- java.lang.Object
-
- edu.gatech.cs2110.circuitsim.api.BasePin
-
- edu.gatech.cs2110.circuitsim.api.OutputPin
-
public class OutputPin extends BasePin
Wraps a CircuitSim outputPin
component and provides a convenience method for setting its value.
-
-
Field Summary
-
Fields inherited from class edu.gatech.cs2110.circuitsim.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 providedPin
component and which lives in the providedSubcircuit
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
get()
Returns the current value of this output pin.int
getSext()
Returns the current value of this output pin sign-extended to 32 bits.-
Methods inherited from class edu.gatech.cs2110.circuitsim.api.BasePin
getPin, getSubcircuit
-
-
-
-
Constructor Detail
-
OutputPin
public OutputPin(com.ra4king.circuitsim.simulator.components.wiring.Pin pin, Subcircuit subcircuit)
Creates a new OutputPin which wraps the providedPin
component and which lives in the providedSubcircuit
.- Parameters:
pin
-Pin
component to wrapsubcircuit
- where this pin lives- See Also:
BasePin(Pin, Subcircuit)
-
-
Method Detail
-
get
public int get()
Returns the current value of this output pin. Does not sign extend (seegetSext()
for that).- Returns:
- value of this pin
- Throws:
IllegalStateException
- If any bit is floating- See Also:
getSext()
-
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:
get()
-
-