package net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.atomic;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import net.mograsim.logic.core.types.Bit;
import net.mograsim.logic.core.types.BitVector;
import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
-import net.mograsim.logic.model.serializing.IdentifierGetter;
+import net.mograsim.logic.model.serializing.IdentifyParams;
import net.mograsim.logic.model.snippets.SnippetDefinintion;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.HighLevelStateHandlerContext;
import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.StandardHighLevelStateHandlerSnippetSuppliers;
public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHighLevelStateHandler
{
- private SubmodelComponent component;
+ private final SubmodelComponent component;
private final List<String> vectorPartTargets;
+ private final List<String> vectorPartTargetsUnmodifiable;
private final List<Integer> vectorPartLengthes;
+ private final List<Integer> vectorPartLengthesUnmodifiable;
private int length;
public BitVectorSplittingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context)
{
this.component = context.component;
this.vectorPartTargets = new ArrayList<>();
+ this.vectorPartTargetsUnmodifiable = Collections.unmodifiableList(vectorPartTargets);
this.vectorPartLengthes = new ArrayList<>();
+ this.vectorPartLengthesUnmodifiable = Collections.unmodifiableList(vectorPartLengthes);
if (params != null)
setVectorParts(params.vectorPartTargets, params.vectorPartLengthes);
}
length += lengthes.stream().mapToInt(Integer::intValue).sum();
}
+ public List<String> getVectorPartTargets()
+ {
+ return vectorPartTargetsUnmodifiable;
+ }
+
+ public List<Integer> getVectorPartLenghtes()
+ {
+ return vectorPartLengthesUnmodifiable;
+ }
+
@Override
public Object getHighLevelState()
{
}
@Override
- public BitVectorSplittingAtomicHighLevelStateHandlerParams getParamsForSerializing(IdentifierGetter idGetter)
+ public String getIDForSerializing(IdentifyParams idParams)
+ {
+ return "bitVectorSplitting";
+ }
+
+ @Override
+ public BitVectorSplittingAtomicHighLevelStateHandlerParams getParamsForSerializing(IdentifyParams idParams)
{
BitVectorSplittingAtomicHighLevelStateHandlerParams params = new BitVectorSplittingAtomicHighLevelStateHandlerParams();
params.vectorPartTargets = new ArrayList<>(vectorPartTargets);