Java Code Examples for com.sun.tools.javac.util.Filter#accepts()

The following examples show how to use com.sun.tools.javac.util.Filter#accepts() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Type.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
public static List<Type> filter(List<Type> ts, Filter<Type> tf) {
    ListBuffer<Type> buf = ListBuffer.lb();
    for (Type t : ts) {
        if (tf.accepts(t)) {
            buf.append(t);
        }
    }
    return buf.toList();
}
 
Example 2
Source File: Scope.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected Entry lookup(Name name, Filter<Symbol> sf) {
    Entry e = table[getIndex(name)];
    if (e == null || e == sentinel)
        return sentinel;
    while (e.scope != null && (e.sym.name != name || (sf != null && !sf.accepts(e.sym))))
        e = e.shadowed;
    return e;
}
 
Example 3
Source File: Scope.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public Iterable<Symbol> getSymbolsByName(Name name,
                                         Filter<Symbol> sf,
                                         LookupKind lookupKind) {
    return sym.name == name &&
           (sf == null || sf.accepts(sym)) ? content : Collections.emptyList();
}
 
Example 4
Source File: InferenceContext.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private List<Type> filterVars(Filter<UndetVar> fu) {
    ListBuffer<Type> res = new ListBuffer<>();
    for (Type t : undetvars) {
        UndetVar uv = (UndetVar)t;
        if (fu.accepts(uv)) {
            res.append(uv.qtype);
        }
    }
    return res.toList();
}
 
Example 5
Source File: Type.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
public static List<Type> filter(List<Type> ts, Filter<Type> tf) {
    ListBuffer<Type> buf = ListBuffer.lb();
    for (Type t : ts) {
        if (tf.accepts(t)) {
            buf.append(t);
        }
    }
    return buf.toList();
}
 
Example 6
Source File: InferenceContext.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private List<Type> filterVars(Filter<UndetVar> fu) {
    ListBuffer<Type> res = new ListBuffer<>();
    for (Type t : undetvars) {
        UndetVar uv = (UndetVar)t;
        if (fu.accepts(uv)) {
            res.append(uv.qtype);
        }
    }
    return res.toList();
}
 
Example 7
Source File: Scope.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public Entry next(Filter<Symbol> sf) {
    if (shadowed.sym == null || sf == null || sf.accepts(shadowed.sym)) return shadowed;
    else return shadowed.next(sf);
}
 
Example 8
Source File: Scope.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public Iterable<Symbol> getSymbols(Filter<Symbol> sf, LookupKind lookupKind) {
    return sf == null || sf.accepts(sym) ? content : Collections.emptyList();
}