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 IComponentInterface 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.booleaninputsValid()Returns whether all inputs are valid.voidinvalidateInputs()Changes the state of all inputs to invalid.voidinvalidateOutputs()Changes the state of all outputs to invalid.Pin[]outputs()Returns the array of Pins representing this component's outputs.booleanoutputsValid()Returns whether all outputs are valid.voidpropagate()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.
-
-