/** * Append all elements in an array to buffer. */ public ListBuffer<A> appendArray(final A[] xs) { for (final A x : xs) { append(x); } return this; }
public static <T> ListBuffer<T> of(final T x) { final ListBuffer<T> lb = new ListBuffer<>(); lb.add(x); return lb; }
/** * Append all elements in a list to buffer. */ public ListBuffer<A> appendList(final ListBuffer<A> xs) { return appendList(xs.toList()); }
final ListBuffer<Type<?>> candidates = new ListBuffer<>(); candidates.add(nestedType); if (candidates.isEmpty()) { return EmptyTypes; return candidates.toArray(new Type[candidates.size()]);
private static ImmutableList<Type<?>> closureMin(ImmutableList<Type<?>> cl) { final ListBuffer<Type<?>> classes = lb(); final ListBuffer<Type<?>> interfaces = lb(); while (!cl.isEmpty()) { final Type current = cl.head; if (current.isInterface()) { interfaces.append(current); } else { classes.append(current); } final ListBuffer<Type<?>> candidates = lb(); for (final Type t : cl.tail) { if (!isSubtypeNoCapture(current, t)) { candidates.append(t); } } cl = candidates.toList(); } return classes.appendList(interfaces).toList(); }
final ListBuffer<Type<?>> from = lb(); final ListBuffer<Type<?>> to = lb(); if (from.isEmpty()) { return t; final ListBuffer<Type<?>> rewrite = lb(); boolean changed = false; for (final Type orig : to.toList()) { Type<?> s = rewriteSupers(orig); if (s.hasSuperBound() && !s.hasExtendsBound()) { changed = true; rewrite.append(s); return substitute(t.getGenericTypeDefinition(), from.toList(), rewrite.toList());
private static TypeList freshTypeVariables(final TypeList types) { final ListBuffer<Type<?>> result = lb(); for (final Type t : types) { if (t.isWildcardType()) { final Type bound = t.getExtendsBound(); result.append(new CapturedType(Type.Bottom, bound, Type.Bottom, t)); } else { result.append(t); } } return new TypeList(result.toList()); }
/** * Append given list buffer at length, forming and returning a new * list. */ public ImmutableList<A> appendList(final ListBuffer<A> x) { return appendList(x.toList()); }
public static <T> ListBuffer<T> lb() { return new ListBuffer<>(); }
/** * Create a new initially empty list buffer. */ public ListBuffer() { clear(); }
public boolean containsAll(final Collection<?> c) { for (final Object x : c) { if (!contains(x)) { return false; } } return true; }
final ListBuffer<Type<?>> candidates = new ListBuffer<>(); candidates.add(nestedType); if (candidates.isEmpty()) { return EmptyTypes; return candidates.toArray(new Type[candidates.size()]);
private static ImmutableList<Type<?>> closureMin(ImmutableList<Type<?>> cl) { final ListBuffer<Type<?>> classes = lb(); final ListBuffer<Type<?>> interfaces = lb(); while (!cl.isEmpty()) { final Type current = cl.head; if (current.isInterface()) { interfaces.append(current); } else { classes.append(current); } final ListBuffer<Type<?>> candidates = lb(); for (final Type t : cl.tail) { if (!isSubtypeNoCapture(current, t)) { candidates.append(t); } } cl = candidates.toList(); } return classes.appendList(interfaces).toList(); }
final ListBuffer<Type<?>> from = lb(); final ListBuffer<Type<?>> to = lb(); if (from.isEmpty()) { return t; final ListBuffer<Type<?>> rewrite = lb(); boolean changed = false; for (final Type orig : to.toList()) { Type<?> s = rewriteSupers(orig); if (s.hasSuperBound() && !s.hasExtendsBound()) { changed = true; rewrite.append(s); return substitute(t.getGenericTypeDefinition(), from.toList(), rewrite.toList());
private static TypeList freshTypeVariables(final TypeList types) { final ListBuffer<Type<?>> result = lb(); for (final Type t : types) { if (t.isWildcardType()) { final Type bound = t.getExtendsBound(); result.append(new CapturedType(Type.Bottom, bound, Type.Bottom, t)); } else { result.append(t); } } return new TypeList(result.toList()); }
/** * Append given list buffer at length, forming and returning a new * list. */ public ImmutableList<A> appendList(final ListBuffer<A> x) { return appendList(x.toList()); }
public static <T> ListBuffer<T> lb() { return new ListBuffer<>(); }
/** * Create a new initially empty list buffer. */ public ListBuffer() { clear(); }