Lines Matching defs:List

41  *  lists via ListBuffers.  List is the main container class in
53 public class List<A> extends AbstractCollection<A> implements java.util.List<A> {
63 public List<A> tail;
67 List(A head, List<A> tail) {
75 public static <A> List<A> nil() {
76 return (List<A>)EMPTY_LIST;
79 private static final List<?> EMPTY_LIST = new List<Object>(null,null) {
80 public List<Object> setTail(List<Object> tail) {
90 public static <A> List<A> filter(List<A> l, A elem) {
92 List<A> res = List.nil();
101 public List<A> intersect(List<A> that) {
111 public List<A> diff(List<A> that) {
124 public List<A> take(int n) {
136 public static <A> List<A> of(A x1) {
137 return new List<>(x1, List.nil());
142 public static <A> List<A> of(A x1, A x2) {
143 return new List<>(x1, of(x2));
148 public static <A> List<A> of(A x1, A x2, A x3) {
149 return new List<>(x1, of(x2, x3));
155 public static <A> List<A> of(A x1, A x2, A x3, A... rest) {
156 return new List<>(x1, new List<>(x2, new List<>(x3, from(rest))));
163 public static <A> List<A> from(A[] array) {
164 List<A> xs = nil();
167 xs = new List<>(array[i], xs);
171 public static <A> List<A> from(Iterable<? extends A> coll) {
184 public static <A> List<A> fill(int len, A init) {
185 List<A> l = nil();
186 for (int i = 0; i < len; i++) l = new List<>(init, l);
208 List<A> l = this;
221 public List<A> setTail(List<A> tail) {
229 public List<A> prepend(A x) {
230 return new List<>(x, this);
236 public List<A> prependList(List<A> xs) {
241 List<A> result = this;
242 List<A> rev = xs.reverse();
245 // individual List objects, instead of allocating new ones.
247 List<A> h = rev;
259 public List<A> reverse() {
264 List<A> rev = nil();
265 for (List<A> l = this; l.nonEmpty(); l = l.tail)
266 rev = new List<>(l.head, rev);
273 public List<A> append(A x) {
280 public List<A> appendList(List<A> x) {
288 public List<A> appendList(ListBuffer<A> x) {
298 List<A> l = this;
327 for (List<A> l = tail; l.nonEmpty(); l = l.tail) {
343 * @see java.util.List#hashCode
347 List<A> l = this;
357 * @see java.util.List#equals
361 if (other instanceof List<?>)
362 return equals(this, (List<?>)other);
363 if (other instanceof java.util.List<?>) {
364 List<A> t = this;
365 Iterator<?> oIter = ((java.util.List<?>) other).iterator();
379 public static boolean equals(List<?> xs, List<?> ys) {
396 List<A> l = this;
412 List<A> t = this;
421 public <Z> List<Z> map(Function<A, Z> mapper) {
429 return changed ? buf.toList() : (List<Z>)this;
433 public static <T> List<T> convert(Class<T> klass, List<?> list) {
438 return (List<T>)list;
463 List<A> elems = List.this;
484 List<A> l = this;
514 for (List<A> l = this; l.tail != null; l = l.tail, i++) {
524 for (List<A> l = this; l.tail != null; l = l.tail, i++) {
539 public java.util.List<A> subList(int fromIndex, int toIndex) {
545 for (List<A> l = this; l.tail != null; l = l.tail, i++) {
558 public static <Z> Collector<Z, ListBuffer<Z>, List<Z>> collector() {