// Path: src/com/thoughtworks/calabash/android/CalabashLogger.java
// public static void warn(String message) {
//     if (shouldLog && isNotEmpty(message))
//         log.warn(String.format(message));
// }


import org.jruby.RubyArray;
import org.jruby.RubyHash;
import java.util.ArrayList;
import static com.thoughtworks.calabash.android.CalabashLogger.warn;
package com.thoughtworks.calabash.android;




public class WebElements extends ArrayList<UIElement> {
    public WebElements(RubyArray elementsArray, String query, CalabashWrapper calabashWrapper) {
        query = query.trim();
        for (Object element : elementsArray) {
            RubyHash object = (RubyHash) element;
            this.add(new UIElement(object, query, calabashWrapper));
        }
    }

    /**
     * touch the webview element, if there are multiple elements, only the first one will be touched
     *
     * @throws CalabashException
     */
    public void touch() throws CalabashException {
        getFirstElement().touch();
    }

    private UIElement getFirstElement() throws CalabashException {
        ensureCollectionIsNotEmpty();
        if (this.size() > 1) {
// Path: src/com/thoughtworks/calabash/android/CalabashLogger.java
// public static void warn(String message) {
//     if (shouldLog && isNotEmpty(message))
//         log.warn(String.format(message));
// }


// Path: src/com/thoughtworks/calabash/android/WebElements.java
import org.jruby.RubyArray;
import org.jruby.RubyHash;
import java.util.ArrayList;
import static com.thoughtworks.calabash.android.CalabashLogger.warn;

package com.thoughtworks.calabash.android;




public class WebElements extends ArrayList<UIElement> {
    public WebElements(RubyArray elementsArray, String query, CalabashWrapper calabashWrapper) {
        query = query.trim();
        for (Object element : elementsArray) {
            RubyHash object = (RubyHash) element;
            this.add(new UIElement(object, query, calabashWrapper));
        }
    }

    /**
     * touch the webview element, if there are multiple elements, only the first one will be touched
     *
     * @throws CalabashException
     */
    public void touch() throws CalabashException {
        getFirstElement().touch();
    }

    private UIElement getFirstElement() throws CalabashException {
        ensureCollectionIsNotEmpty();
        if (this.size() > 1) {
            warn("There are multiple webview elements, so considering only the first element");