private ArrayList<Type<?>> populateInterfaces(final Filter filter) { final ArrayList<Type<?>> list = new ArrayList<>(); final Type<?> reflectedType = getReflectedType(); final HashSet<Type<?>> set = new HashSet<>(); final ImmutableList<Type<?>> interfaceList = Helper.interfaces(reflectedType); for (final Type interfaceType : interfaceList) { final String name = interfaceType.getFullName(); if (filter.match(name) && set.add(interfaceType)) { list.add(interfaceType); } } return list; }
private ArrayList<Type<?>> populateInterfaces(final Filter filter) { final ArrayList<Type<?>> list = new ArrayList<>(); final Type<?> reflectedType = getReflectedType(); final HashSet<Type<?>> set = new HashSet<>(); final ImmutableList<Type<?>> interfaceList = Helper.interfaces(reflectedType); for (final Type interfaceType : interfaceList) { final String name = interfaceType.getFullName(); if (filter.match(name) && set.add(interfaceType)) { list.add(interfaceType); } } return list; }
private ArrayList<Type<?>> populateInterfaces(final Filter filter) { final ArrayList<Type<?>> list = new ArrayList<>(); final Type<?> reflectedType = getReflectedType(); final HashSet<Type<?>> set = new HashSet<>(); final ImmutableList<Type<?>> interfaceList = Helper.interfaces(reflectedType); for (final Type interfaceType : interfaceList) { final String name = interfaceType.getFullName(); if (filter.match(name) && set.add(interfaceType)) { list.add(interfaceType); } } return list; }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
public static int rank(final Type t) { if (t == null) { return 0; } if (t.isPrimitive() || t.isWildcardType() || t.isArray() || t == Type.Bottom || t == Type.NullType) { throw new AssertionError(); } if (t == Types.Object) { return 0; } int r = rank(superType(t)); for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { final int headRank = rank(l.head); if (headRank > r) { r = headRank; } } return r + 1; }
public static int rank(final Type t) { if (t == null) { return 0; } if (t.isPrimitive() || t.isWildcardType() || t.isArray() || t == Type.Bottom || t == Type.NullType) { throw new AssertionError(); } if (t == Types.Object) { return 0; } int r = rank(superType(t)); for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { final int headRank = rank(l.head); if (headRank > r) { r = headRank; } } return r + 1; }
public static int rank(final Type t) { if (t == null) { return 0; } if (t.isPrimitive() || t.isWildcardType() || t.isArray() || t == Type.Bottom || t == Type.NullType) { throw new AssertionError(); } if (t == Types.Object) { return 0; } int r = rank(superType(t)); for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { final int headRank = rank(l.head); if (headRank > r) { r = headRank; } } return r + 1; }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }