/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2, final A x3) { return new ImmutableList<>(x1, of(x2, x3)); }
/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2, final A x3) { return new ImmutableList<>(x1, of(x2, x3)); }
/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2, final A x3) { return new ImmutableList<>(x1, of(x2, x3)); }
/** * Append given element at length, forming and returning * a new list. */ public ImmutableList<A> append(final A x) { return of(x).prependList(this); }
/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2) { return new ImmutableList<>(x1, of(x2)); }
/** * Append given element at length, forming and returning * a new list. */ public ImmutableList<A> append(final A x) { return of(x).prependList(this); }
/** * Append given element at length, forming and returning * a new list. */ public ImmutableList<A> append(final A x) { return of(x).prependList(this); }
/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2) { return new ImmutableList<>(x1, of(x2)); }
/** * Construct a list consisting of given elements. */ public static <A> ImmutableList<A> of(final A x1, final A x2) { return new ImmutableList<>(x1, of(x2)); }
@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 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; }