X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fmi%2Fparameters%2FParameterClassification.java;h=c81f6e556968361e55934d7d3b251e71dbc553de;hb=8bed58cd47f4e53a0a83e066d38864aa6875502f;hp=b9362a09f3c7a85561b81573ef59e84c2d4d6d42;hpb=5e4efdd581f04578be5f59e591f4bcf746df44d8;p=Mograsim.git diff --git a/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/ParameterClassification.java b/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/ParameterClassification.java index b9362a09..c81f6e55 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/ParameterClassification.java +++ b/net.mograsim.machine/src/net/mograsim/machine/mi/parameters/ParameterClassification.java @@ -6,12 +6,25 @@ public interface ParameterClassification { /** * Determines whether a {@link MicroInstructionParameter} is part of this class of parameters. + * * @return true if the classification contains the Parameter, false otherwise */ - public boolean conforms(MicroInstructionParameter param); - + public default boolean conforms(MicroInstructionParameter param) + { + return param.getType().equals(getExpectedType()) && param.getValue().length() == getExpectedBits(); + } + /** * @return The type of the parameters in this classification. */ public ParameterType getExpectedType(); + + /** + * @return The number of bits of the parameters in this classification. + */ + public int getExpectedBits(); + + public MicroInstructionParameter parse(String toParse); + + public MicroInstructionParameter getDefault(); }