X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2FModelComponent.java;h=d543c543ebc2050f044e8cd309e6b07a36f98e1a;hb=ad841126238b8b7653a311a9c89d3dada18ce3c5;hp=9171ee839b7a82061619ae66e205b47045079231;hpb=d953262602b4b7771472a14b0fb8fbb3cc5faaf0;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java index 9171ee83..d543c543 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/ModelComponent.java @@ -168,17 +168,30 @@ public abstract class ModelComponent implements JSONSerializable * Returns the pin with the given name of this component. * * @throws IllegalArgumentException if there is no pin with the given name + * @see #getPinOrNull(String) * * @author Daniel Kirschten */ public Pin getPin(String name) { - Pin pin = pinsByName.get(name); + Pin pin = getPinOrNull(name); if (pin == null) throw new IllegalArgumentException("No pin with the name " + name); return pin; } + /** + * Returns the pin with the given name of this component, or null if there is no such pin. + * + * @see #getPin(String) + * + * @author Daniel Kirschten + */ + public Pin getPinOrNull(String name) + { + return pinsByName.get(name); + } + // high-level access /**