Save This Page
Home » openjdk-7 » com.sun.tools » javac » util » [javadoc | source]
com.sun.tools.javac.util
public class: List [javadoc | source]
java.lang.Object
   java.util.AbstractCollection<A>
      com.sun.tools.javac.util.List

All Implemented Interfaces:
    List, Collection

A class for generic linked lists. Links are supposed to be immutable, the only exception being the incremental construction of lists via ListBuffers. List is the main container class in GJC. Most data structures and algorthms in GJC use lists rather than arrays.

Lists are always trailed by a sentinel element, whose head and tail are both null.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Field Summary
public  A head    The first element of the list, supposed to be immutable. 
public  List<A> tail    The remainder of the list except for its first element, supposed to be immutable. 
Constructor:
 List(A head,
    List<A> tail) 
    Construct a list given its head and tail.
Method from com.sun.tools.javac.util.List Summary:
add,   addAll,   append,   appendList,   appendList,   contains,   convert,   equals,   equals,   fill,   from,   get,   hashCode,   indexOf,   isEmpty,   iterator,   last,   lastIndexOf,   length,   listIterator,   listIterator,   nil,   nonEmpty,   of,   of,   of,   of,   prepend,   prependList,   remove,   reverse,   set,   setTail,   size,   subList,   toArray,   toArray,   toString,   toString
Methods from java.util.AbstractCollection:
add,   addAll,   clear,   contains,   containsAll,   isEmpty,   iterator,   remove,   removeAll,   retainAll,   size,   toArray,   toArray,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.util.List Detail:
 public  void add(int index,
    A element) 
 public boolean addAll(int index,
    Collection<? extends A> c) 
 public List<A> append(A x) 
    Append given element at length, forming and returning a new list.
 public List<A> appendList(List<A> x) 
    Append given list at length, forming and returning a new list.
 public List<A> appendList(ListBuffer<A> x) 
    Append given list buffer at length, forming and returning a new list.
 public boolean contains(Object x) 
    Does the list contain the specified element?
 public static List<T> convert(Class<T> klass,
    List<?> list) 
 public boolean equals(Object other) 
    Is this list the same as other list?
 public static boolean equals(List<?> xs,
    List<?> ys) 
    Are the two lists the same?
 public static List<A> fill(int len,
    A init) 
    Construct a list consisting of a given number of identical elements.
 public static List<A> from(A[] array) 
    Construct a list consisting all elements of given array.
 public A get(int index) 
 public int hashCode() 
    Compute a hash code, overrides Object
 public int indexOf(Object o) 
 public boolean isEmpty() 
    Does list have no elements?
 public Iterator<A> iterator() 
 public A last() 
    The last element in the list, if any, or null.
 public int lastIndexOf(Object o) 
 public int length() 
    Return the number of elements in this list.
 public ListIterator<A> listIterator() 
 public ListIterator<A> listIterator(int index) 
 public static List<A> nil() 
    Construct an empty list.
 public boolean nonEmpty() 
    Does list have elements?
 public static List<A> of(A x1) 
    Construct a list consisting of given element.
 public static List<A> of(A x1,
    A x2) 
    Construct a list consisting of given elements.
 public static List<A> of(A x1,
    A x2,
    A x3) 
    Construct a list consisting of given elements.
 public static List<A> of(A x1,
    A x2,
    A x3,
    A rest) 
    Construct a list consisting of given elements.
 public List<A> prepend(A x) 
    Prepend given element to front of list, forming and returning a new list.
 public List<A> prependList(List<A> xs) 
    Prepend given list of elements to front of list, forming and returning a new list.
 public A remove(int index) 
 public List<A> reverse() 
    Reverse list. If the list is empty or a singleton, then the same list is returned. Otherwise a new list is formed.
 public A set(int index,
    A element) 
 public List<A> setTail(List<A> tail) 
 public int size() 
 public List<A> subList(int fromIndex,
    int toIndex) 
 public Object[] toArray() 
 public T[] toArray(T[] vec) 
    Copy successive elements of this list into given vector until list is exhausted or end of vector is reached.
 public String toString() 
    Form a string listing all elements with comma as the separator character.
 public String toString(String sep) 
    Form a string listing all elements with given separator character.