// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/IOIOConnection.java
// public interface IOIOConnection {
//     void waitForConnect() throws ConnectionLostException;
// 
//     void disconnect();
// 
//     InputStream getInputStream() throws ConnectionLostException;
// 
//     OutputStream getOutputStream() throws ConnectionLostException;
// 
//     /**
//      * Can this connection be closed. Normally the answer would be "true", but
//      * some weird connections cannot be closed and need the higher layer to do
//      * a "soft close" instead.
//      *
//      * @return true This connection can be closed.
//      */
//     boolean canClose();
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/IOIOFactory.java
// public class IOIOFactory {
//     /**
//      * Create a IOIO instance. This specific implementation creates a IOIO
//      * instance which works with the actual IOIO board connected via a TCP
//      * connection (typically over a wired USB connection).
//      *
//      * @return The IOIO instance.
//      */
//     public static IOIO create() {
//         Collection<IOIOConnectionFactory> factories = IOIOConnectionRegistry
//                 .getConnectionFactories();
//         try {
//             return create(factories.iterator().next().createConnection());
//         } catch (NoSuchElementException e) {
//             Log.e(TAG, "No connection is available. This shouldn't happen.");
//             throw e;
//         }
//     }
// 
//     /**
//      * Create a IOIO instance with a user-provided underlying connection class.
//      * This method should be used for establishing a non-standard connection to
//      * the IOIO board.
//      *
//      * @param connection An instance of a IOIO connection.
//      * @return The IOIO instance.
//      */
//     public static IOIO create(IOIOConnection connection) {
//         return new IOIOImpl(connection);
//     }
// 
//     private static final String TAG = "IOIOFactory";
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/IOIOConnectionBootstrap.java
// public interface IOIOConnectionBootstrap {
//     public void getFactories(Collection<IOIOConnectionFactory> result);
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/IOIOConnectionFactory.java
// public interface IOIOConnectionFactory {
//     /**
//      * A unique name of the connection type. Typically a fully-qualified
//      * name of the connection class.
//      */
//     public String getType();
// 
//     /**
//      * Extra information on the connection. This is specific to the
//      * connection type. For example, for a Bluetooth connection, this is an
//      * array containing the name and the Bluetooth address of the remote
//      * IOIO.
//      */
//     public Object getExtra();
// 
//     public IOIOConnection createConnection();
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/Log.java
// public class Log {
//     public static int println(int priority, String tag, String msg) {
//         return android.util.Log.println(priority, tag, msg);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable tr) {
//         android.util.Log.e(tag, message, tr);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable tr) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void d(String tag, String message) {
//         android.util.Log.d(tag, message);
//     }
// 
//     public static void v(String tag, String message) {
//         android.util.Log.v(tag, message);
//     }
// }


import ioio.lib.api.IOIOConnection;
import ioio.lib.api.IOIOFactory;
import ioio.lib.spi.IOIOConnectionBootstrap;
import ioio.lib.spi.IOIOConnectionFactory;
import ioio.lib.spi.Log;
import ioio.lib.spi.NoRuntimeSupportException;
import java.util.Collection;
import java.util.LinkedList;

    /**
     * For advanced usage only! Add platform-specific connection bootstrap
     * classes. Call before calling {@link #getConnectionFactories()}.
     */
    public static void addBootstraps(String[] classNames) {
        for (String className : classNames) {
            addBootstrap(className);
        }
    }

    private static final String TAG = "IOIOConnectionRegistry";

    private static Collection<IOIOConnectionBootstrap> bootstraps_;

    static {
        bootstraps_ = new LinkedList<IOIOConnectionBootstrap>();
    }

    private static void addBootstrap(String className) {
        try {
            Class<? extends IOIOConnectionBootstrap> bootstrapClass = Class
                    .forName(className).asSubclass(
                            IOIOConnectionBootstrap.class);
            bootstraps_.add(bootstrapClass.newInstance());
            Log.d(TAG, "Successfully added bootstrap class: " + className);
        } catch (ClassNotFoundException e) {
            Log.d(TAG, "Bootstrap class not found: " + className
                    + ". Not adding.");
        } catch (NoRuntimeSupportException e) {
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/IOIOConnection.java
// public interface IOIOConnection {
//     void waitForConnect() throws ConnectionLostException;
// 
//     void disconnect();
// 
//     InputStream getInputStream() throws ConnectionLostException;
// 
//     OutputStream getOutputStream() throws ConnectionLostException;
// 
//     /**
//      * Can this connection be closed. Normally the answer would be "true", but
//      * some weird connections cannot be closed and need the higher layer to do
//      * a "soft close" instead.
//      *
//      * @return true This connection can be closed.
//      */
//     boolean canClose();
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/IOIOFactory.java
// public class IOIOFactory {
//     /**
//      * Create a IOIO instance. This specific implementation creates a IOIO
//      * instance which works with the actual IOIO board connected via a TCP
//      * connection (typically over a wired USB connection).
//      *
//      * @return The IOIO instance.
//      */
//     public static IOIO create() {
//         Collection<IOIOConnectionFactory> factories = IOIOConnectionRegistry
//                 .getConnectionFactories();
//         try {
//             return create(factories.iterator().next().createConnection());
//         } catch (NoSuchElementException e) {
//             Log.e(TAG, "No connection is available. This shouldn't happen.");
//             throw e;
//         }
//     }
// 
//     /**
//      * Create a IOIO instance with a user-provided underlying connection class.
//      * This method should be used for establishing a non-standard connection to
//      * the IOIO board.
//      *
//      * @param connection An instance of a IOIO connection.
//      * @return The IOIO instance.
//      */
//     public static IOIO create(IOIOConnection connection) {
//         return new IOIOImpl(connection);
//     }
// 
//     private static final String TAG = "IOIOFactory";
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/IOIOConnectionBootstrap.java
// public interface IOIOConnectionBootstrap {
//     public void getFactories(Collection<IOIOConnectionFactory> result);
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/IOIOConnectionFactory.java
// public interface IOIOConnectionFactory {
//     /**
//      * A unique name of the connection type. Typically a fully-qualified
//      * name of the connection class.
//      */
//     public String getType();
// 
//     /**
//      * Extra information on the connection. This is specific to the
//      * connection type. For example, for a Bluetooth connection, this is an
//      * array containing the name and the Bluetooth address of the remote
//      * IOIO.
//      */
//     public Object getExtra();
// 
//     public IOIOConnection createConnection();
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/spi/Log.java
// public class Log {
//     public static int println(int priority, String tag, String msg) {
//         return android.util.Log.println(priority, tag, msg);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable tr) {
//         android.util.Log.e(tag, message, tr);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable tr) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void d(String tag, String message) {
//         android.util.Log.d(tag, message);
//     }
// 
//     public static void v(String tag, String message) {
//         android.util.Log.v(tag, message);
//     }
// }


// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/util/IOIOConnectionRegistry.java
import ioio.lib.api.IOIOConnection;
import ioio.lib.api.IOIOFactory;
import ioio.lib.spi.IOIOConnectionBootstrap;
import ioio.lib.spi.IOIOConnectionFactory;
import ioio.lib.spi.Log;
import ioio.lib.spi.NoRuntimeSupportException;
import java.util.Collection;
import java.util.LinkedList;


    /**
     * For advanced usage only! Add platform-specific connection bootstrap
     * classes. Call before calling {@link #getConnectionFactories()}.
     */
    public static void addBootstraps(String[] classNames) {
        for (String className : classNames) {
            addBootstrap(className);
        }
    }

    private static final String TAG = "IOIOConnectionRegistry";

    private static Collection<IOIOConnectionBootstrap> bootstraps_;

    static {
        bootstraps_ = new LinkedList<IOIOConnectionBootstrap>();
    }

    private static void addBootstrap(String className) {
        try {
            Class<? extends IOIOConnectionBootstrap> bootstrapClass = Class
                    .forName(className).asSubclass(
                            IOIOConnectionBootstrap.class);
            bootstraps_.add(bootstrapClass.newInstance());
            Log.d(TAG, "Successfully added bootstrap class: " + className);
        } catch (ClassNotFoundException e) {
            Log.d(TAG, "Bootstrap class not found: " + className
                    + ". Not adding.");
        } catch (NoRuntimeSupportException e) {
            Log.d(TAG, "No runtime support for: " + className + ". Not adding.");