Package api
Interface IComponent
-
- All Known Subinterfaces:
IStatefulComponent
- All Known Implementing Classes:
AbstractComponent
,AbstractStatefulComponent
,AndGate
,CompoundComponent
,Counter
,ExternalValue
,FullAdder
,HalfAdder
,MultiComponent
,Multiplexer
,NotGate
,OrGate
,Register
public interface IComponent
Interface representing a component in a simulation of digital circuits.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Pin[]
inputs()
Returns the array of Pins representing this component's inputs.boolean
inputsValid()
Returns whether all inputs are valid.void
invalidateInputs()
Changes the state of all inputs to invalid.void
invalidateOutputs()
Changes the state of all outputs to invalid.Pin[]
outputs()
Returns the array of Pins representing this component's outputs.boolean
outputsValid()
Returns whether all outputs are valid.void
propagate()
Propagates inputs to outputs.
-
-
-
Method Detail
-
inputs
Pin[] inputs()
Returns the array of Pins representing this component's inputs.- Returns:
- array of input Pins
-
outputs
Pin[] outputs()
Returns the array of Pins representing this component's outputs.- Returns:
- array of output Pins
-
inputsValid
boolean inputsValid()
Returns whether all inputs are valid.- Returns:
- true if all inputs are valid, false otherwise
-
outputsValid
boolean outputsValid()
Returns whether all outputs are valid.- Returns:
- true if all outputs are valid, false otherwise
-
invalidateInputs
void invalidateInputs()
Changes the state of all inputs to invalid.
-
invalidateOutputs
void invalidateOutputs()
Changes the state of all outputs to invalid.
-
propagate
void propagate()
Propagates inputs to outputs. Does nothing if not all inputs are valid.
-
-