/** * Prepend an element to buffer. */ public ListBuffer<A> prepend(final A x) { elements = elements.prepend(x); count++; return this; }
/** * Prepend an element to buffer. */ public ListBuffer<A> prepend(final A x) { elements = elements.prepend(x); count++; return this; }
/** * Prepend an element to buffer. */ public ListBuffer<A> prepend(final A x) { elements = elements.prepend(x); count++; return this; }
public static ImmutableList<Type<?>> union(final ImmutableList<Type<?>> cl1, final ImmutableList<Type<?>> cl2) { if (cl1.isEmpty()) { return cl2; } else if (cl2.isEmpty()) { return cl1; } else if (precedes(cl1.head, cl2.head)) { return union(cl1.tail, cl2).prepend(cl1.head); } else if (precedes(cl2.head, cl1.head)) { return union(cl1, cl2.tail).prepend(cl2.head); } else { return union(cl1.tail, cl2.tail).prepend(cl1.head); } }
public static ImmutableList<Type<?>> union(final ImmutableList<Type<?>> cl1, final ImmutableList<Type<?>> cl2) { if (cl1.isEmpty()) { return cl2; } else if (cl2.isEmpty()) { return cl1; } else if (precedes(cl1.head, cl2.head)) { return union(cl1.tail, cl2).prepend(cl1.head); } else if (precedes(cl2.head, cl1.head)) { return union(cl1, cl2.tail).prepend(cl2.head); } else { return union(cl1.tail, cl2.tail).prepend(cl1.head); } }
public static ImmutableList<Type<?>> union(final ImmutableList<Type<?>> cl1, final ImmutableList<Type<?>> cl2) { if (cl1.isEmpty()) { return cl2; } else if (cl2.isEmpty()) { return cl1; } else if (precedes(cl1.head, cl2.head)) { return union(cl1.tail, cl2).prepend(cl1.head); } else if (precedes(cl2.head, cl1.head)) { return union(cl1, cl2.tail).prepend(cl2.head); } else { return union(cl1.tail, cl2.tail).prepend(cl1.head); } }
return prepend(xs.head);
return prepend(xs.head);
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; }