// Path: src/main/java/com/nikhaldimann/viewselector/selection/ViewSelection.java
// public class ViewSelection extends LinkedHashSet<View> {
// 
// }


import java.util.Set;
import se.fishtank.css.selectors.Selector;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.nikhaldimann.viewselector.selection.ViewSelection;
package com.nikhaldimann.viewselector.checker;




/**
 * Checks views based on matching the tag from a selector to the class of
 * a view.
 */
public class ClassChecker implements ViewTraversalChecker {

    private final Selector selector;
    private final MatchPredicate matchPredicate;

    public ClassChecker(Selector selector, View root) {
        this.selector = selector;

        final String className = selector.getTagName();
        if (className.equals(Selector.UNIVERSAL_TAG)) {
            matchPredicate = MatchPredicates.ALWAYS_TRUE_PREDICATE;
        } else {
            matchPredicate = new MatchPredicate() {
                public boolean matches(View view) {
                    return className.equals(view.getClass().getSimpleName());
                }
            };
        }
    }

// Path: src/main/java/com/nikhaldimann/viewselector/selection/ViewSelection.java
// public class ViewSelection extends LinkedHashSet<View> {
// 
// }


// Path: src/main/java/com/nikhaldimann/viewselector/checker/ClassChecker.java
import java.util.Set;
import se.fishtank.css.selectors.Selector;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.nikhaldimann.viewselector.selection.ViewSelection;

package com.nikhaldimann.viewselector.checker;




/**
 * Checks views based on matching the tag from a selector to the class of
 * a view.
 */
public class ClassChecker implements ViewTraversalChecker {

    private final Selector selector;
    private final MatchPredicate matchPredicate;

    public ClassChecker(Selector selector, View root) {
        this.selector = selector;

        final String className = selector.getTagName();
        if (className.equals(Selector.UNIVERSAL_TAG)) {
            matchPredicate = MatchPredicates.ALWAYS_TRUE_PREDICATE;
        } else {
            matchPredicate = new MatchPredicate() {
                public boolean matches(View view) {
                    return className.equals(view.getClass().getSimpleName());
                }
            };
        }
    }

    public ViewSelection check(Set<View> views) {