The final restructured version for automatic build using maven tycho
[Mograsim.git] / plugins / net.mograsim.machine / src / net / mograsim / machine / mi / parameters / ParameterClassification.java
1 package net.mograsim.machine.mi.parameters;
2
3 import net.mograsim.machine.mi.parameters.MicroInstructionParameter.ParameterType;
4
5 public interface ParameterClassification
6 {
7         /**
8          * Determines whether a {@link MicroInstructionParameter} is part of this class of parameters.
9          * 
10          * @return true if the classification contains the Parameter, false otherwise
11          */
12         public default boolean conforms(MicroInstructionParameter param)
13         {
14                 return param.getType().equals(getExpectedType()) && param.getValue().length() == getExpectedBits();
15         }
16
17         /**
18          * @return The type of the parameters in this classification.
19          */
20         public ParameterType getExpectedType();
21
22         /**
23          * @return The number of bits of the parameters in this classification.
24          */
25         public int getExpectedBits();
26
27         public MicroInstructionParameter parse(String toParse);
28
29         public MicroInstructionParameter getDefault();
30 }