/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.reflection;

import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collector;
import net.ranides.assira.collection.query.CQuery;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IElements<T> extends Iterable<T> {
    
    int count();
    
    boolean isEmpty();
    
    <R> CQuery<R> stream(Function<? super T, ? extends R> mapper);
    
    CQuery<T> stream();
    
    void each(Consumer<? super T> consumer);
    
    <R> List<R> list(Function<? super T, R> mapper);
    
    List<T> list();
    
    <R, A> R collect(Collector<? super T, A, R> collector);

    Optional<T> first();
    
    List<String> names();
    
    IElements<? extends IElement> parent();
    
    IElements<T> hint(IHints attr);
    
}
