From 80782104ec97cd6f6853f3710a0762e933b7f148 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 19 Aug 2025 06:31:55 +0000 Subject: [PATCH] Add getter methods for primary input bindings and outputs Co-authored-by: gquar24 --- lib/src/main/java/sim/core/Circuit.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/src/main/java/sim/core/Circuit.java b/lib/src/main/java/sim/core/Circuit.java index 7a092ac..852f596 100644 --- a/lib/src/main/java/sim/core/Circuit.java +++ b/lib/src/main/java/sim/core/Circuit.java @@ -260,4 +260,22 @@ public List getGates() { public List getWires() { return new ArrayList<>(wires); } + + /** + * Returns a copy of the primary input bindings map. + * + *

The returned map preserves insertion order of primary inputs but is a + * shallow copy. Modifications to the returned map or its lists will not + * affect the circuit's internal state.

+ */ + public Map> getPrimaryInputBindings() { + return new LinkedHashMap<>(primaryInputBindings); + } + + /** + * Returns a copy of the list of gates designated as primary outputs. + */ + public List getPrimaryOutputs() { + return new ArrayList<>(primaryOutputs); + } }