public void connect(Statement other) { for (Connector plug : connectors) { if (plug.isOutgoing() || plug.isParameter()) { for (Connector socket : other.connectors) { if (socket.isIncoming()) { if (socket.overlaps(plug)) { plug.setConnection(other); socket.setConnection(other); } } } } } }