aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorPhil Burk <[email protected]>2021-10-30 10:55:40 -0700
committerGitHub <[email protected]>2021-10-30 10:55:40 -0700
commite87459a16189a1935d6035a6a2ace0e615903352 (patch)
treeaf95ad56e6bfa7493b0b8c9d8245408032bcc4cc /src/main/java
parentff6a638feaaf2df38929e77c6a81975ba560282b (diff)
Add getUnits() method to Circuit. (#104)
Add new TestCircuit unit test.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/jsyn/unitgen/Circuit.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/jsyn/unitgen/Circuit.java b/src/main/java/com/jsyn/unitgen/Circuit.java
index 01cb860..db516a7 100644
--- a/src/main/java/com/jsyn/unitgen/Circuit.java
+++ b/src/main/java/com/jsyn/unitgen/Circuit.java
@@ -119,4 +119,13 @@ public class Circuit extends UnitGenerator {
return port;
}
+ /**
+ * The units are guaranteed to be in the same order
+ * as they were added.
+ *
+ * @return an array of units that have been added to this circuit.
+ */
+ UnitGenerator[] getUnits() {
+ return units.toArray(new UnitGenerator[0]);
+ }
}