package metisto.digisim;

public final class Components {

    public static Connection undefined() {
        return () -> {
            throw new RuntimeException("undefined");
        };
    }

    public static Connection fixed(final boolean value) {
        return () -> value;
    }

    public static Wire wire() {
        return new Wire();
    }

    public static Wire wire(final Connection input) {
        final Wire wire = wire();
        wire.input(input);
        return wire;
    }

    static BinaryGate and(final Connection a, final Connection b) {
        final BinaryGate and = new BinaryGate(BinaryGate.Operators.AND);
        and.a(a);
        and.b(b);
        return and;
    }

    static BinaryGate or(final Connection a, final Connection b) {
        final BinaryGate or = new BinaryGate(BinaryGate.Operators.OR);
        or.a(a);
        or.b(b);
        return or;
    }

    static BinaryGate xor(final Connection a, final Connection b) {
        final BinaryGate xor = new BinaryGate(BinaryGate.Operators.XOR);
        xor.a(a);
        xor.b(b);
        return xor;
    }

    static HalfAdder halfAdder(final Connection a, final Connection b) {
        final HalfAdder halfAdder = new HalfAdder();
        halfAdder.a(a);
        halfAdder.b(b);
        return halfAdder;
    }

    static FullAdder fullAdder(final Connection a, final Connection b, final Connection r) {
        final FullAdder fullAdder = new FullAdder();
        fullAdder.a(a);
        fullAdder.b(b);
        fullAdder.r(r);
        return fullAdder;
    }
}

@@ -487,32 +487,39 @@
 ire;%0A    %7D%0A%0A    
+public 
 static BinaryGat
@@ -558,32 +558,32 @@
 Connection b) %7B%0A
-
         final Bi
@@ -698,32 +698,39 @@
 and;%0A    %7D%0A%0A    
+public 
 static BinaryGat
@@ -907,24 +907,31 @@
 %0A    %7D%0A%0A    
+public 
 static Binar
@@ -1118,24 +1118,31 @@
 %0A    %7D%0A%0A    
+public 
 static HalfA
@@ -1332,20 +1332,27 @@
 %0A    %7D%0A%0A
-
     
+public 
 static F

Make components public