X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fsnippets%2Fhighlevelstatehandlers%2Fstandard%2Fatomic%2FBitVectorSplittingAtomicHighLevelStateHandler.java;h=4b9e2d62bcf122b6a0f3574f4a6b95a753b30f4c;hb=5140b424c507b8f22f80b452e475d0b56a3a36ce;hp=b5630a52906f6a84ab938f079ce6c9a08abdf9ac;hpb=662fb8ae0007c317aa210b1de50499b47f38477a;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java index b5630a52..4b9e2d62 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/atomic/BitVectorSplittingAtomicHighLevelStateHandler.java @@ -1,6 +1,7 @@ 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; @@ -13,9 +14,11 @@ import net.mograsim.logic.model.snippets.highlevelstatehandlers.standard.Standar public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHighLevelStateHandler { - private SubmodelComponent component; + private final SubmodelComponent component; private final List vectorPartTargets; + private final List vectorPartTargetsUnmodifiable; private final List vectorPartLengthes; + private final List vectorPartLengthesUnmodifiable; private int length; public BitVectorSplittingAtomicHighLevelStateHandler(HighLevelStateHandlerContext context) @@ -28,7 +31,9 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh { 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); } @@ -62,6 +67,16 @@ public class BitVectorSplittingAtomicHighLevelStateHandler implements AtomicHigh length += lengthes.stream().mapToInt(Integer::intValue).sum(); } + public List getVectorPartTargets() + { + return vectorPartTargetsUnmodifiable; + } + + public List getVectorPartLenghtes() + { + return vectorPartLengthesUnmodifiable; + } + @Override public Object getHighLevelState() {