Lines Matching defs:List

39  *  lists via ListBuffers.  List is the main container class in
51 public class List<A> extends AbstractCollection<A> implements java.util.List<A> {
61 public List<A> tail;
65 List(A head, List<A> tail) {
73 public static <A> List<A> nil() {
74 return (List<A>)EMPTY_LIST;
77 private static List<?> EMPTY_LIST = new List<Object>(null,null) {
78 public List<Object> setTail(List<Object> tail) {
88 public static <A> List<A> of(A x1) {
89 return new List<A>(x1, List.<A>nil());
94 public static <A> List<A> of(A x1, A x2) {
95 return new List<A>(x1, of(x2));
100 public static <A> List<A> of(A x1, A x2, A x3) {
101 return new List<A>(x1, of(x2, x3));
107 public static <A> List<A> of(A x1, A x2, A x3, A... rest) {
108 return new List<A>(x1, new List<A>(x2, new List<A>(x3, from(rest))));
115 public static <A> List<A> from(A[] array) {
116 List<A> xs = nil();
119 xs = new List<A>(array[i], xs);
128 public static <A> List<A> fill(int len, A init) {
129 List<A> l = nil();
130 for (int i = 0; i < len; i++) l = new List<A>(init, l);
152 List<A> l = this;
165 public List<A> setTail(List<A> tail) {
173 public List<A> prepend(A x) {
174 return new List<A>(x, this);
180 public List<A> prependList(List<A> xs) {
185 List<A> result = this;
186 List<A> rev = xs.reverse();
189 // individual List objects, instead of allocating new ones.
191 List<A> h = rev;
203 public List<A> reverse() {
208 List<A> rev = nil();
209 for (List<A> l = this; l.nonEmpty(); l = l.tail)
210 rev = new List<A>(l.head, rev);
217 public List<A> append(A x) {
224 public List<A> appendList(List<A> x) {
232 public List<A> appendList(ListBuffer<A> x) {
242 List<A> l = this;
271 for (List<A> l = tail; l.nonEmpty(); l = l.tail) {
287 * @see java.util.List#hashCode
291 List<A> l = this;
301 * @see java.util.List#equals
305 if (other instanceof List<?>)
306 return equals(this, (List<?>)other);
307 if (other instanceof java.util.List<?>) {
308 List<A> t = this;
309 Iterator<?> oIter = ((java.util.List<?>) other).iterator();
323 public static boolean equals(List<?> xs, List<?> ys) {
340 List<A> l = this;
356 List<A> t = this;
365 public static <T> List<T> convert(Class<T> klass, List<?> list) {
370 return (List<T>)list;
395 List<A> elems = List.this;
416 List<A> l = this;
446 for (List<A> l = this; l.tail != null; l = l.tail, i++) {
456 for (List<A> l = this; l.tail != null; l = l.tail, i++) {
471 public java.util.List<A> subList(int fromIndex, int toIndex) {
477 for (List<A> l = this; l.tail != null; l = l.tail, i++) {