projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A MicroInstructionDefinition now has a default
[Mograsim.git]
/
net.mograsim.machine
/
src
/
net
/
mograsim
/
machine
/
mi
/
parameters
/
ParameterClassification.java
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
b9362a0
..
c81f6e5
100644
(file)
--- 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.
{
/**
* Determines whether a {@link MicroInstructionParameter} is part of this class of parameters.
+ *
* @return true if the classification contains the Parameter, false otherwise
*/
* @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 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();
}
}