1 package spoon.reflect.visitor; 2 3 import spoon.reflect.declaration.CtElement; 4 5 /** 6 * This interface defines a filter for program elements. 7 * 8 * @param T the type of the filtered elements (an element belonging to the 9 * filtered element must be assignable from <code>T</code>). 10 */ 11 public interface Filter<T extends CtElement> { 12 /** 13 * Tells if the given element matches. 14 */ 15 boolean matches(T element); 16 17 /** 18 * Gets the runtime type that corresponds to the <code>T</code> parameter 19 * (the type of the filtered elements). Any element assignable from this 20 * type is a potential match and is tested using the {@link #matches(CtElement)} 21 * method, while other elements are never a match. 22 */ 23 Class<T> getType(); 24 } 25