harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r598631 [1/2] - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/
Date Tue, 27 Nov 2007 13:14:21 GMT
Author: tellison
Date: Tue Nov 27 05:14:12 2007
New Revision: 598631

URL: http://svn.apache.org/viewvc?rev=598631&view=rev
Log:
Code formatting (tabs -> spaces).

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Date.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatConversionException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatFlagsException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatPrecisionException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatWidthException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/InputMismatchException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashSet.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedList.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/ListIterator.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MapEntry.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MissingFormatArgumentException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MissingFormatWidthException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/MissingResourceException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/NoSuchElementException.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Observer.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/PropertyResourceBundle.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SortedMap.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/SortedSet.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Date.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Date.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Date.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Date.java Tue Nov 27 05:14:12 2007
@@ -721,9 +721,9 @@
      * @return long
      * 
      * @deprecated use: <code>
-     *	Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
-     *	cal.set(year + 1900, month, day, hour, minute, second);
-     * 	cal.getTime().getTime();</code>
+     * Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
+     * cal.set(year + 1900, month, day, hour, minute, second);
+     * cal.getTime().getTime();</code>
      */
     @Deprecated
     public static long UTC(int year, int month, int day, int hour, int minute,

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatConversionException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatConversionException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatConversionException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatConversionException.java Tue Nov 27 05:14:12 2007
@@ -21,63 +21,65 @@
 /**
  * The unchecked exception will be thrown out when the parameter is incompatible
  * with the corresponding format specifier.
+ * 
  * @since 1.5
  */
 public class IllegalFormatConversionException extends IllegalFormatException
-		implements Serializable {
-	private static final long serialVersionUID = 17000126L;
+        implements Serializable {
 
-	private char c;
+    private static final long serialVersionUID = 17000126L;
 
-	private Class<?> arg;
+    private char c;
 
-	/**
-	 * Constructs an IllegalFormatConversionException with the class of the
-	 * mismatched conversion and corresponding parameter.
-	 * 
-	 * @param c
-	 *            The class of the mismatched conversion.
-	 * @param arg
-	 *            The corresponding parameter.
-	 */
-	public IllegalFormatConversionException(char c, Class<?> arg) {
-		this.c = c;
-		if (arg == null) {
-			throw new NullPointerException();
-		}
-		this.arg = arg;
-	}
-
-	/**
-	 * Return the class of the mismatched parameter.
-	 * 
-	 * @return The class of the mismatched parameter.
-	 */
-	public Class<?> getArgumentClass() {
-		return arg;
-	}
-
-	/**
-	 * Return the incompatible conversion.
-	 * 
-	 * @return The incompatible conversion.
-	 */
-	public char getConversion() {
-		return c;
-	}
-
-	/**
-	 * Return the message string of the IllegalFormatConversionException.
-	 * 
-	 * @return The message string of the IllegalFormatConversionException.
-	 */
-	@Override
+    private Class<?> arg;
+
+    /**
+     * Constructs an IllegalFormatConversionException with the class of the
+     * mismatched conversion and corresponding parameter.
+     * 
+     * @param c
+     *            The class of the mismatched conversion.
+     * @param arg
+     *            The corresponding parameter.
+     */
+    public IllegalFormatConversionException(char c, Class<?> arg) {
+        this.c = c;
+        if (arg == null) {
+            throw new NullPointerException();
+        }
+        this.arg = arg;
+    }
+
+    /**
+     * Return the class of the mismatched parameter.
+     * 
+     * @return The class of the mismatched parameter.
+     */
+    public Class<?> getArgumentClass() {
+        return arg;
+    }
+
+    /**
+     * Return the incompatible conversion.
+     * 
+     * @return The incompatible conversion.
+     */
+    public char getConversion() {
+        return c;
+    }
+
+    /**
+     * Return the message string of the IllegalFormatConversionException.
+     * 
+     * @return The message string of the IllegalFormatConversionException.
+     */
+    @Override
     public String getMessage() {
-		StringBuilder buffer = new StringBuilder();
-		buffer.append(c);
-		buffer.append(" is incompatible with ");
-		buffer.append(arg.getName());
-		return buffer.toString();
-	}
+        StringBuilder buffer = new StringBuilder();
+        buffer.append(c);
+        buffer.append(" is incompatible with ");
+        buffer.append(arg.getName());
+        return buffer.toString();
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatException.java Tue Nov 27 05:14:12 2007
@@ -24,12 +24,12 @@
  * is allowed to be instantiated.
  */
 public class IllegalFormatException extends IllegalArgumentException implements
-		Serializable {
+        Serializable {
 
-	private static final long serialVersionUID = 18830826L;
+    private static final long serialVersionUID = 18830826L;
 
-	// the constructor is not callable from outside from the package
-	IllegalFormatException() {
-		// do nothing
-	}
+    // the constructor is not callable from outside from the package
+    IllegalFormatException() {
+        // do nothing
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatFlagsException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatFlagsException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatFlagsException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatFlagsException.java Tue Nov 27 05:14:12 2007
@@ -19,51 +19,49 @@
 import java.io.Serializable;
 
 /**
- * 
  * The unchecked exception will be thrown out if the combination of the format
  * flags is illegal.
- * 
  */
 public class IllegalFormatFlagsException extends IllegalFormatException
-		implements Serializable {
-	private static final long serialVersionUID = 790824L;
+        implements Serializable {
 
-	private String flags;
+    private static final long serialVersionUID = 790824L;
 
-	/**
-	 * Constructs an IllegalFormatFlagsException with the specified flags.
-	 * 
-	 * @param f
-	 *            The specified flags.
-	 */
-	public IllegalFormatFlagsException(String f) {
-		if (null == f) {
-			throw new NullPointerException();
-		}
-		flags = f;
-	}
+    private String flags;
 
-	/**
-	 * Return the flags that are illegal.
-	 * 
-	 * @return The flags that are illegal.
-	 */
-	public String getFlags() {
-		return flags;
-	}
+    /**
+     * Constructs an IllegalFormatFlagsException with the specified flags.
+     * 
+     * @param f
+     *            The specified flags.
+     */
+    public IllegalFormatFlagsException(String f) {
+        if (null == f) {
+            throw new NullPointerException();
+        }
+        flags = f;
+    }
 
-	/**
-	 * Return the message string of the IllegalFormatFlagsException.
-	 * 
-	 * @return The message string of the IllegalFormatFlagsException.
-	 */
-	@Override
-    public String getMessage() {
-		StringBuilder buffer = new StringBuilder();
-		buffer.append("Flags = '");
-		buffer.append(flags);
-		buffer.append("'");
-		return buffer.toString();
-	}
+    /**
+     * Return the flags that are illegal.
+     * 
+     * @return The flags that are illegal.
+     */
+    public String getFlags() {
+        return flags;
+    }
 
+    /**
+     * Return the message string of the IllegalFormatFlagsException.
+     * 
+     * @return The message string of the IllegalFormatFlagsException.
+     */
+    @Override
+    public String getMessage() {
+        StringBuilder buffer = new StringBuilder();
+        buffer.append("Flags = '");
+        buffer.append(flags);
+        buffer.append("'");
+        return buffer.toString();
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatPrecisionException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatPrecisionException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatPrecisionException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatPrecisionException.java Tue Nov 27 05:14:12 2007
@@ -17,45 +17,43 @@
 package java.util;
 
 /**
- * 
  * The unchecked exception will be thrown out when the precision is a negative
  * other than -1, or the conversion does not support a precision or other cases
  * when the precision is not supported.
- * 
  */
-
 public class IllegalFormatPrecisionException extends IllegalFormatException {
-	private static final long serialVersionUID = 18711008L;
 
-	private int p;
+    private static final long serialVersionUID = 18711008L;
+
+    private int p;
 
-	/**
-	 * Constructs a IllegalFormatPrecisionException with specified precision.
-	 * 
-	 * @param p
-	 *            The precision.
-	 */
-	public IllegalFormatPrecisionException(int p) {
-		this.p = p;
-	}
+    /**
+     * Constructs a IllegalFormatPrecisionException with specified precision.
+     * 
+     * @param p
+     *            The precision.
+     */
+    public IllegalFormatPrecisionException(int p) {
+        this.p = p;
+    }
 
-	/**
-	 * Returns the precision associated with the exception.
-	 * 
-	 * @return the precision.
-	 */
-	public int getPrecision() {
-		return p;
-	}
+    /**
+     * Returns the precision associated with the exception.
+     * 
+     * @return the precision.
+     */
+    public int getPrecision() {
+        return p;
+    }
 
-	/**
-	 * Returns the message of the exception.
-	 * 
-	 * @return The message of the exception.
-	 */
-	@Override
+    /**
+     * Returns the message of the exception.
+     * 
+     * @return The message of the exception.
+     */
+    @Override
     public String getMessage() {
-		return String.valueOf(p);
-	}
+        return String.valueOf(p);
+    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatWidthException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatWidthException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatWidthException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/IllegalFormatWidthException.java Tue Nov 27 05:14:12 2007
@@ -17,44 +17,42 @@
 package java.util;
 
 /**
- * 
  * The unchecked exception will be thrown out when the width is a negative other
  * than -1, or the conversion does not support a width or other cases when the
  * width is not supported.
- * 
  */
 public class IllegalFormatWidthException extends IllegalFormatException {
 
-	private static final long serialVersionUID = 16660902L;
+    private static final long serialVersionUID = 16660902L;
 
-	private int w;
+    private int w;
 
-	/**
-	 * Constructs a IllegalFormatWidthException with specified width.
-	 * 
-	 * @param w
-	 *            The width.
-	 */
-	public IllegalFormatWidthException(int w) {
-		this.w = w;
-	}
+    /**
+     * Constructs a IllegalFormatWidthException with specified width.
+     * 
+     * @param w
+     *            The width.
+     */
+    public IllegalFormatWidthException(int w) {
+        this.w = w;
+    }
 
-	/**
-	 * Returns the width associated with the exception.
-	 * 
-	 * @return the width.
-	 */
-	public int getWidth() {
-		return w;
-	}
+    /**
+     * Returns the width associated with the exception.
+     * 
+     * @return the width.
+     */
+    public int getWidth() {
+        return w;
+    }
 
-	/**
-	 * Returns the message of the exception.
-	 * 
-	 * @return The message of the exception.
-	 */
-	@Override
+    /**
+     * Returns the message of the exception.
+     * 
+     * @return The message of the exception.
+     */
+    @Override
     public String getMessage() {
-		return String.valueOf(w);
-	}
+        return String.valueOf(w);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/InputMismatchException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/InputMismatchException.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/InputMismatchException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/InputMismatchException.java Tue Nov 27 05:14:12 2007
@@ -24,25 +24,25 @@
  * @see Scanner
  */
 public class InputMismatchException extends NoSuchElementException implements
-		Serializable {
+        Serializable {
 
-	static final long serialVersionUID = 8811230760997066428L;
-	
-	/**
-	 * Constructs a InputMismatchException with no error message
-	 * 
-	 */
-	public InputMismatchException() {
-		super();
-	}
+    static final long serialVersionUID = 8811230760997066428L;
 
-	/**
-	 * Constructs a InputMismatchException with msg as its error message
-	 * 
-	 * @param msg
-	 *            The specified error message
-	 */
-	public InputMismatchException(String msg) {
-		super(msg);
-	}
+    /**
+     * Constructs a InputMismatchException with no error message
+     * 
+     */
+    public InputMismatchException() {
+        super();
+    }
+
+    /**
+     * Constructs a InputMismatchException with msg as its error message
+     * 
+     * @param msg
+     *            The specified error message
+     */
+    public InputMismatchException(String msg) {
+        super(msg);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Iterator.java Tue Nov 27 05:14:12 2007
@@ -17,43 +17,42 @@
 
 package java.util;
 
-
 /**
  * An Iterator is used to sequence over a collection of objects.
  */
 public interface Iterator<E> {
-	/**
-	 * Answers if there are more elements to iterate.
-	 * 
-	 * @return true if there are more elements, false otherwise
-	 * 
-	 * @see #next
-	 */
-	public boolean hasNext();
+    /**
+     * Answers if there are more elements to iterate.
+     * 
+     * @return true if there are more elements, false otherwise
+     * 
+     * @see #next
+     */
+    public boolean hasNext();
 
-	/**
-	 * Answers the next object in the iteration.
-	 * 
-	 * @return the next object
-	 * 
-	 * @exception NoSuchElementException
-	 *                when there are no more elements
-	 * 
-	 * @see #hasNext
-	 */
-	public E next();
+    /**
+     * Answers the next object in the iteration.
+     * 
+     * @return the next object
+     * 
+     * @exception NoSuchElementException
+     *                when there are no more elements
+     * 
+     * @see #hasNext
+     */
+    public E next();
 
-	/**
-	 * Removes the last object returned by <code>next</code> from the
-	 * collection.
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing is not supported by the collection being
-	 *                iterated
-	 * @exception IllegalStateException
-	 *                when <code>next</code> has not been called, or
-	 *                <code>remove</code> has already been called after the
-	 *                last call to <code>next</code>
-	 */
-	public void remove();
+    /**
+     * Removes the last object returned by <code>next</code> from the
+     * collection.
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing is not supported by the collection being
+     *                iterated
+     * @exception IllegalStateException
+     *                when <code>next</code> has not been called, or
+     *                <code>remove</code> has already been called after the
+     *                last call to <code>next</code>
+     */
+    public void remove();
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashSet.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashSet.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedHashSet.java Tue Nov 27 05:14:12 2007
@@ -17,72 +17,74 @@
 
 package java.util;
 
-
 import java.io.Serializable;
 
 /**
- * LinkedHashSet is a variant on HashSet. Its entries are kept in a doubly-linked list.
- * The iteration order is the order in which entries were inserted.
+ * LinkedHashSet is a variant on HashSet. Its entries are kept in a
+ * doubly-linked list. The iteration order is the order in which entries were
+ * inserted.
  * <p>
  * Null elements are allowed, and all the optional Set operations are supported.
  * <p>
- * Like HashSet, LinkedHashSet is not thread safe, so access by multiple threads must be synchronized
- * by an external mechanism such as Collections.synchronizedSet.
+ * Like HashSet, LinkedHashSet is not thread safe, so access by multiple threads
+ * must be synchronized by an external mechanism such as
+ * Collections.synchronizedSet.
+ * 
  * @since 1.4
  */
 public class LinkedHashSet<E> extends HashSet<E> implements Set<E>, Cloneable,
-		Serializable {
-	
-	private static final long serialVersionUID = -2851667679971038690L;
-
-	/**
-	 * Constructs a new empty instance of LinkedHashSet.
-	 */
-	public LinkedHashSet() {
-		super(new LinkedHashMap<E, HashSet<E>>());
-	}
-
-	/**
-	 * Constructs a new instance of LinkedHashSet with the specified capacity.
-	 * 
-	 * @param capacity
-	 *            the initial capacity of this HashSet
-	 */
-	public LinkedHashSet(int capacity) {
-		super(new LinkedHashMap<E, HashSet<E>>(capacity));
-	}
-
-	/**
-	 * Constructs a new instance of LinkedHashSet with the specified capacity
-	 * and load factor.
-	 * 
-	 * @param capacity
-	 *            the initial capacity
-	 * @param loadFactor
-	 *            the initial load factor
-	 */
-	public LinkedHashSet(int capacity, float loadFactor) {
-		super(new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor));
-	}
-
-	/**
-	 * Constructs a new instance of LinkedHashSet containing the unique elements
-	 * in the specified collection.
-	 * 
-	 * @param collection
-	 *            the collection of elements to add
-	 */
-	public LinkedHashSet(Collection<? extends E> collection) {
-		super(new LinkedHashMap<E, HashSet<E>>(collection.size() < 6 ? 11
-				: collection.size() * 2));
+        Serializable {
+
+    private static final long serialVersionUID = -2851667679971038690L;
+
+    /**
+     * Constructs a new empty instance of LinkedHashSet.
+     */
+    public LinkedHashSet() {
+        super(new LinkedHashMap<E, HashSet<E>>());
+    }
+
+    /**
+     * Constructs a new instance of LinkedHashSet with the specified capacity.
+     * 
+     * @param capacity
+     *            the initial capacity of this HashSet
+     */
+    public LinkedHashSet(int capacity) {
+        super(new LinkedHashMap<E, HashSet<E>>(capacity));
+    }
+
+    /**
+     * Constructs a new instance of LinkedHashSet with the specified capacity
+     * and load factor.
+     * 
+     * @param capacity
+     *            the initial capacity
+     * @param loadFactor
+     *            the initial load factor
+     */
+    public LinkedHashSet(int capacity, float loadFactor) {
+        super(new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor));
+    }
+
+    /**
+     * Constructs a new instance of LinkedHashSet containing the unique elements
+     * in the specified collection.
+     * 
+     * @param collection
+     *            the collection of elements to add
+     */
+    public LinkedHashSet(Collection<? extends E> collection) {
+        super(new LinkedHashMap<E, HashSet<E>>(collection.size() < 6 ? 11
+                : collection.size() * 2));
         for (E e : collection) {
             add(e);
         }
-	}
+    }
 
-	/* overrides method in HashMap */
-	@Override
+    /* overrides method in HashMap */
+    @Override
     HashMap<E, HashSet<E>> createBackingMap(int capacity, float loadFactor) {
-		return new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor);
-	}
+        return new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedList.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedList.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedList.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/LinkedList.java Tue Nov 27 05:14:12 2007
@@ -17,7 +17,6 @@
 
 package java.util;
 
-
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -28,245 +27,248 @@
  * LinkedList is an implementation of List, backed by a linked list. All
  * optional operations are supported, adding, removing and replacing. The
  * elements can be any objects.
+ * 
  * @since 1.2
  */
 public class LinkedList<E> extends AbstractSequentialList<E> implements
         List<E>, Queue<E>, Cloneable, Serializable {
-	
-	private static final long serialVersionUID = 876323262645176354L;
 
-	transient int size = 0;
+    private static final long serialVersionUID = 876323262645176354L;
+
+    transient int size = 0;
+
+    transient Link<E> voidLink;
+
+    private static final class Link<ET> {
+        ET data;
 
-	transient Link<E> voidLink;
+        Link<ET> previous, next;
+
+        Link(ET o, Link<ET> p, Link<ET> n) {
+            data = o;
+            previous = p;
+            next = n;
+        }
+    }
 
-	private static final class Link<ET> {
-		ET data;
-
-		Link<ET> previous, next;
-
-		Link(ET o, Link<ET> p, Link<ET> n) {
-			data = o;
-			previous = p;
-			next = n;
-		}
-	}
-
-	private static final class LinkIterator<ET> implements ListIterator<ET> {
-		int pos, expectedModCount;
-
-		final LinkedList<ET> list;
-
-		Link<ET> link, lastLink;
-
-		LinkIterator(LinkedList<ET> object, int location) {
-			list = object;
-			expectedModCount = list.modCount;
-			if (0 <= location && location <= list.size) {
-				// pos ends up as -1 if list is empty, it ranges from -1 to
-				// list.size - 1
-				// if link == voidLink then pos must == -1
-				link = list.voidLink;
-				if (location < list.size / 2) {
-					for (pos = -1; pos + 1 < location; pos++) {
+    private static final class LinkIterator<ET> implements ListIterator<ET> {
+        int pos, expectedModCount;
+
+        final LinkedList<ET> list;
+
+        Link<ET> link, lastLink;
+
+        LinkIterator(LinkedList<ET> object, int location) {
+            list = object;
+            expectedModCount = list.modCount;
+            if (0 <= location && location <= list.size) {
+                // pos ends up as -1 if list is empty, it ranges from -1 to
+                // list.size - 1
+                // if link == voidLink then pos must == -1
+                link = list.voidLink;
+                if (location < list.size / 2) {
+                    for (pos = -1; pos + 1 < location; pos++) {
                         link = link.next;
                     }
-				} else {
-					for (pos = list.size; pos >= location; pos--) {
+                } else {
+                    for (pos = list.size; pos >= location; pos--) {
                         link = link.previous;
                     }
-				}
-			} else {
+                }
+            } else {
                 throw new IndexOutOfBoundsException();
             }
-		}
+        }
 
-		public void add(ET object) {
-			if (expectedModCount == list.modCount) {
-				Link<ET> next = link.next;
-				Link<ET> newLink = new Link<ET>(object, link, next);
-				link.next = newLink;
-				next.previous = newLink;
-				link = newLink;
-				lastLink = null;
-				pos++;
-				expectedModCount++;
-				list.size++;
-				list.modCount++;
-			} else {
+        public void add(ET object) {
+            if (expectedModCount == list.modCount) {
+                Link<ET> next = link.next;
+                Link<ET> newLink = new Link<ET>(object, link, next);
+                link.next = newLink;
+                next.previous = newLink;
+                link = newLink;
+                lastLink = null;
+                pos++;
+                expectedModCount++;
+                list.size++;
+                list.modCount++;
+            } else {
                 throw new ConcurrentModificationException();
             }
-		}
+        }
+
+        public boolean hasNext() {
+            return link.next != list.voidLink;
+        }
 
-		public boolean hasNext() {
-			return link.next != list.voidLink;
-		}
-
-		public boolean hasPrevious() {
-			return link != list.voidLink;
-		}
-
-		public ET next() {
-			if (expectedModCount == list.modCount) {
-				LinkedList.Link<ET> next = link.next;
-				if (next != list.voidLink) {
-					lastLink = link = next;
-					pos++;
-					return link.data;
-				}
+        public boolean hasPrevious() {
+            return link != list.voidLink;
+        }
+
+        public ET next() {
+            if (expectedModCount == list.modCount) {
+                LinkedList.Link<ET> next = link.next;
+                if (next != list.voidLink) {
+                    lastLink = link = next;
+                    pos++;
+                    return link.data;
+                }
                 throw new NoSuchElementException();
-			}
+            }
             throw new ConcurrentModificationException();
-		}
+        }
+
+        public int nextIndex() {
+            return pos + 1;
+        }
 
-		public int nextIndex() {
-			return pos + 1;
-		}
-
-		public ET previous() {
-			if (expectedModCount == list.modCount) {
-				if (link != list.voidLink) {
-					lastLink = link;
-					link = link.previous;
-					pos--;
-					return lastLink.data;
-				}
+        public ET previous() {
+            if (expectedModCount == list.modCount) {
+                if (link != list.voidLink) {
+                    lastLink = link;
+                    link = link.previous;
+                    pos--;
+                    return lastLink.data;
+                }
                 throw new NoSuchElementException();
-			}
+            }
             throw new ConcurrentModificationException();
-		}
+        }
+
+        public int previousIndex() {
+            return pos;
+        }
 
-		public int previousIndex() {
-			return pos;
-		}
-
-		public void remove() {
-			if (expectedModCount == list.modCount) {
-				if (lastLink != null) {
-					Link<ET> next = lastLink.next;
-					Link<ET> previous = lastLink.previous;
-					next.previous = previous;
-					previous.next = next;
-					if (lastLink == link) {
+        public void remove() {
+            if (expectedModCount == list.modCount) {
+                if (lastLink != null) {
+                    Link<ET> next = lastLink.next;
+                    Link<ET> previous = lastLink.previous;
+                    next.previous = previous;
+                    previous.next = next;
+                    if (lastLink == link) {
                         pos--;
                     }
-					link = previous;
-					lastLink = null;
-					expectedModCount++;
-					list.size--;
-					list.modCount++;
-				} else {
+                    link = previous;
+                    lastLink = null;
+                    expectedModCount++;
+                    list.size--;
+                    list.modCount++;
+                } else {
                     throw new IllegalStateException();
                 }
-			} else {
+            } else {
                 throw new ConcurrentModificationException();
             }
-		}
+        }
 
-		public void set(ET object) {
-			if (expectedModCount == list.modCount) {
-				if (lastLink != null) {
+        public void set(ET object) {
+            if (expectedModCount == list.modCount) {
+                if (lastLink != null) {
                     lastLink.data = object;
                 } else {
                     throw new IllegalStateException();
                 }
-			} else {
+            } else {
                 throw new ConcurrentModificationException();
             }
-		}
-	}
+        }
+    }
+
+    /**
+     * Constructs a new empty instance of LinkedList.
+     * 
+     */
+    public LinkedList() {
+        voidLink = new Link<E>(null, null, null);
+        voidLink.previous = voidLink;
+        voidLink.next = voidLink;
+    }
 
-	/**
-	 * Constructs a new empty instance of LinkedList.
-	 * 
-	 */
-	public LinkedList() {
-		voidLink = new Link<E>(null, null, null);
-		voidLink.previous = voidLink;
-		voidLink.next = voidLink;
-	}
-
-	/**
-	 * Constructs a new instance of <code>LinkedList</code> that holds 
-	 * all of the elements contained in the supplied <code>collection</code>
-	 * argument. The order of the elements in this new <code>LinkedList</code> 
-	 * will be determined by the iteration order of <code>collection</code>. 
-	 * 
-	 * @param collection
-	 *            the collection of elements to add
-	 */
-	public LinkedList(Collection<? extends E> collection) {
-		this();
-		addAll(collection);
-	}
-
-	/**
-	 * Inserts the specified object into this LinkedList at the specified
-	 * location. The object is inserted before any previous element at the
-	 * specified location. If the location is equal to the size of this
-	 * LinkedList, the object is added at the end.
-	 * 
-	 * @param location
-	 *            the index at which to insert
-	 * @param object
-	 *            the object to add
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	@Override
+    /**
+     * Constructs a new instance of <code>LinkedList</code> that holds all of
+     * the elements contained in the supplied <code>collection</code>
+     * argument. The order of the elements in this new <code>LinkedList</code>
+     * will be determined by the iteration order of <code>collection</code>.
+     * 
+     * @param collection
+     *            the collection of elements to add
+     */
+    public LinkedList(Collection<? extends E> collection) {
+        this();
+        addAll(collection);
+    }
+
+    /**
+     * Inserts the specified object into this LinkedList at the specified
+     * location. The object is inserted before any previous element at the
+     * specified location. If the location is equal to the size of this
+     * LinkedList, the object is added at the end.
+     * 
+     * @param location
+     *            the index at which to insert
+     * @param object
+     *            the object to add
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    @Override
     public void add(int location, E object) {
-		if (0 <= location && location <= size) {
-			Link<E> link = voidLink;
-			if (location < (size / 2)) {
-				for (int i = 0; i <= location; i++) {
+        if (0 <= location && location <= size) {
+            Link<E> link = voidLink;
+            if (location < (size / 2)) {
+                for (int i = 0; i <= location; i++) {
                     link = link.next;
                 }
-			} else {
-				for (int i = size; i > location; i--) {
+            } else {
+                for (int i = size; i > location; i--) {
                     link = link.previous;
                 }
-			}
-			Link<E> previous = link.previous;
-			Link<E> newLink = new Link<E>(object, previous, link);
-			previous.next = newLink;
-			link.previous = newLink;
-			size++;
-			modCount++;
-		} else {
+            }
+            Link<E> previous = link.previous;
+            Link<E> newLink = new Link<E>(object, previous, link);
+            previous.next = newLink;
+            link.previous = newLink;
+            size++;
+            modCount++;
+        } else {
             throw new IndexOutOfBoundsException();
         }
-	}
+    }
 
-	/**
-	 * Adds the specified object at the end of this LinkedList.
-	 * 
-	 * @param object
-	 *            the object to add
-	 * @return true
-	 */
-	@Override
+    /**
+     * Adds the specified object at the end of this LinkedList.
+     * 
+     * @param object
+     *            the object to add
+     * @return true
+     */
+    @Override
     public boolean add(E object) {
-		// Cannot call addLast() as subclasses can override
-		Link<E> oldLast = voidLink.previous;
-		Link<E> newLink = new Link<E>(object, oldLast, voidLink);
-		voidLink.previous = newLink;
-		oldLast.next = newLink;
-		size++;
-		modCount++;
-		return true;
-	}
+        // Cannot call addLast() as subclasses can override
+        Link<E> oldLast = voidLink.previous;
+        Link<E> newLink = new Link<E>(object, oldLast, voidLink);
+        voidLink.previous = newLink;
+        oldLast.next = newLink;
+        size++;
+        modCount++;
+        return true;
+    }
 
-	/**
+    /**
      * Inserts the objects in the specified Collection at the specified location
      * in this LinkedList. The objects are added in the order they are returned
      * from the <code>Collection</code> iterator.
      * 
-     * @param location the index at which to insert
-     * @param collection the Collection of objects
+     * @param location
+     *            the index at which to insert
+     * @param collection
+     *            the Collection of objects
      * @return true if this LinkedList is modified, false otherwise
      * 
-     * @exception IndexOutOfBoundsException when
-     *            <code>location < 0 || > size()</code>
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || > size()</code>
      */
     @Override
     public boolean addAll(int location, Collection<? extends E> collection) {
@@ -300,88 +302,87 @@
         return true;
     }
 
-
-	/**
-	 * Adds the objects in the specified Collection to this LinkedList.
-	 * 
-	 * @param collection
-	 *            the Collection of objects
-	 * @return true if this LinkedList is modified, false otherwise
-	 */
-	@Override
+    /**
+     * Adds the objects in the specified Collection to this LinkedList.
+     * 
+     * @param collection
+     *            the Collection of objects
+     * @return true if this LinkedList is modified, false otherwise
+     */
+    @Override
     public boolean addAll(Collection<? extends E> collection) {
-		int adding = collection.size();
-		if (adding == 0) {
+        int adding = collection.size();
+        if (adding == 0) {
             return false;
         }
-		Link<E> previous = voidLink.previous;
+        Link<E> previous = voidLink.previous;
         for (E e : collection) {
-			Link<E> newLink = new Link<E>(e, previous, null);
-			previous.next = newLink;
-			previous = newLink;
-		}
-		previous.next = voidLink;
-		voidLink.previous = previous;
-		size += adding;
-		modCount++;
-		return true;
-	}
-
-	/**
-	 * Adds the specified object at the beginning of this LinkedList.
-	 * 
-	 * @param object
-	 *            the object to add
-	 */
-	public void addFirst(E object) {
-		Link<E> oldFirst = voidLink.next;
-		Link<E> newLink = new Link<E>(object, voidLink, oldFirst);
-		voidLink.next = newLink;
-		oldFirst.previous = newLink;
-		size++;
-		modCount++;
-	}
-
-	/**
-	 * Adds the specified object at the end of this LinkedList.
-	 * 
-	 * @param object
-	 *            the object to add
-	 */
-	public void addLast(E object) {
-		Link<E> oldLast = voidLink.previous;
-		Link<E> newLink = new Link<E>(object, oldLast, voidLink);
-		voidLink.previous = newLink;
-		oldLast.next = newLink;
-		size++;
-		modCount++;
-	}
-
-	/**
-	 * Removes all elements from this LinkedList, leaving it empty.
-	 * 
-	 * @see List#isEmpty
-	 * @see #size
-	 */
-	@Override
+            Link<E> newLink = new Link<E>(e, previous, null);
+            previous.next = newLink;
+            previous = newLink;
+        }
+        previous.next = voidLink;
+        voidLink.previous = previous;
+        size += adding;
+        modCount++;
+        return true;
+    }
+
+    /**
+     * Adds the specified object at the beginning of this LinkedList.
+     * 
+     * @param object
+     *            the object to add
+     */
+    public void addFirst(E object) {
+        Link<E> oldFirst = voidLink.next;
+        Link<E> newLink = new Link<E>(object, voidLink, oldFirst);
+        voidLink.next = newLink;
+        oldFirst.previous = newLink;
+        size++;
+        modCount++;
+    }
+
+    /**
+     * Adds the specified object at the end of this LinkedList.
+     * 
+     * @param object
+     *            the object to add
+     */
+    public void addLast(E object) {
+        Link<E> oldLast = voidLink.previous;
+        Link<E> newLink = new Link<E>(object, oldLast, voidLink);
+        voidLink.previous = newLink;
+        oldLast.next = newLink;
+        size++;
+        modCount++;
+    }
+
+    /**
+     * Removes all elements from this LinkedList, leaving it empty.
+     * 
+     * @see List#isEmpty
+     * @see #size
+     */
+    @Override
     public void clear() {
-		if (size > 0) {
-			size = 0;
-			voidLink.next = voidLink;
-			voidLink.previous = voidLink;
-			modCount++;
-		}
-	}
-
-	/**
-	 * Answers a new LinkedList with the same elements and size as this
-	 * LinkedList.
-	 * 
-	 * @return a shallow copy of this LinkedList
-	 * 
-	 * @see java.lang.Cloneable
-	 */
-	@SuppressWarnings("unchecked")
+        if (size > 0) {
+            size = 0;
+            voidLink.next = voidLink;
+            voidLink.previous = voidLink;
+            modCount++;
+        }
+    }
+
+    /**
+     * Answers a new LinkedList with the same elements and size as this
+     * LinkedList.
+     * 
+     * @return a shallow copy of this LinkedList
+     * 
+     * @see java.lang.Cloneable
+     */
+    @SuppressWarnings("unchecked")
     @Override
     public Object clone() {
         try {
@@ -395,313 +396,313 @@
         } catch (CloneNotSupportedException e) {
             return null;
         }
-	}
+    }
 
-	/**
-	 * Searches this LinkedList for the specified object.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return true if <code>object</code> is an element of this LinkedList,
-	 *         false otherwise
-	 */
-	@Override
+    /**
+     * Searches this LinkedList for the specified object.
+     * 
+     * @param object
+     *            the object to search for
+     * @return true if <code>object</code> is an element of this LinkedList,
+     *         false otherwise
+     */
+    @Override
     public boolean contains(Object object) {
-		Link<E> link = voidLink.next;
-		if (object != null) {
-			while (link != voidLink) {
-				if (object.equals(link.data)) {
+        Link<E> link = voidLink.next;
+        if (object != null) {
+            while (link != voidLink) {
+                if (object.equals(link.data)) {
                     return true;
                 }
-				link = link.next;
-			}
-		} else {
-			while (link != voidLink) {
-				if (link.data == null) {
+                link = link.next;
+            }
+        } else {
+            while (link != voidLink) {
+                if (link.data == null) {
                     return true;
                 }
-				link = link.next;
-			}
-		}
-		return false;
-	}
+                link = link.next;
+            }
+        }
+        return false;
+    }
 
-	@Override
+    @Override
     public E get(int location) {
-		if (0 <= location && location < size) {
-			Link<E> link = voidLink;
-			if (location < (size / 2)) {
-				for (int i = 0; i <= location; i++) {
+        if (0 <= location && location < size) {
+            Link<E> link = voidLink;
+            if (location < (size / 2)) {
+                for (int i = 0; i <= location; i++) {
                     link = link.next;
                 }
-			} else {
-				for (int i = size; i > location; i--) {
+            } else {
+                for (int i = size; i > location; i--) {
                     link = link.previous;
                 }
-			}
-			return link.data;
-		}
+            }
+            return link.data;
+        }
         throw new IndexOutOfBoundsException();
-	}
+    }
 
-	/**
-	 * Answers the first element in this LinkedList.
-	 * 
-	 * @return the first element
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this LinkedList is empty
-	 */
-	public E getFirst() {
-		Link<E> first = voidLink.next;
-		if (first != voidLink) {
+    /**
+     * Answers the first element in this LinkedList.
+     * 
+     * @return the first element
+     * 
+     * @exception NoSuchElementException
+     *                when this LinkedList is empty
+     */
+    public E getFirst() {
+        Link<E> first = voidLink.next;
+        if (first != voidLink) {
             return first.data;
         }
-		throw new NoSuchElementException();
-	}
+        throw new NoSuchElementException();
+    }
 
-	/**
-	 * Answers the last element in this LinkedList.
-	 * 
-	 * @return the last element
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this LinkedList is empty
-	 */
-	public E getLast() {
-		Link<E> last = voidLink.previous;
-		if (last != voidLink) {
+    /**
+     * Answers the last element in this LinkedList.
+     * 
+     * @return the last element
+     * 
+     * @exception NoSuchElementException
+     *                when this LinkedList is empty
+     */
+    public E getLast() {
+        Link<E> last = voidLink.previous;
+        if (last != voidLink) {
             return last.data;
         }
-		throw new NoSuchElementException();
-	}
+        throw new NoSuchElementException();
+    }
 
-	/**
-	 * Searches this LinkedList for the specified object and returns the index
-	 * of the first occurrence.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return the index of the first occurrence of the object
-	 */
-	@Override
+    /**
+     * Searches this LinkedList for the specified object and returns the index
+     * of the first occurrence.
+     * 
+     * @param object
+     *            the object to search for
+     * @return the index of the first occurrence of the object
+     */
+    @Override
     public int indexOf(Object object) {
-		int pos = 0;
-		Link<E> link = voidLink.next;
-		if (object != null) {
-			while (link != voidLink) {
-				if (object.equals(link.data)) {
+        int pos = 0;
+        Link<E> link = voidLink.next;
+        if (object != null) {
+            while (link != voidLink) {
+                if (object.equals(link.data)) {
                     return pos;
                 }
-				link = link.next;
-				pos++;
-			}
-		} else {
-			while (link != voidLink) {
-				if (link.data == null) {
+                link = link.next;
+                pos++;
+            }
+        } else {
+            while (link != voidLink) {
+                if (link.data == null) {
                     return pos;
                 }
-				link = link.next;
-				pos++;
-			}
-		}
-		return -1;
-	}
-
-	/**
-	 * Searches this LinkedList for the specified object and returns the index
-	 * of the last occurrence.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return the index of the last occurrence of the object
-	 */
-	@Override
+                link = link.next;
+                pos++;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Searches this LinkedList for the specified object and returns the index
+     * of the last occurrence.
+     * 
+     * @param object
+     *            the object to search for
+     * @return the index of the last occurrence of the object
+     */
+    @Override
     public int lastIndexOf(Object object) {
-		int pos = size;
-		Link<E> link = voidLink.previous;
-		if (object != null) {
-			while (link != voidLink) {
-				pos--;
-				if (object.equals(link.data)) {
+        int pos = size;
+        Link<E> link = voidLink.previous;
+        if (object != null) {
+            while (link != voidLink) {
+                pos--;
+                if (object.equals(link.data)) {
                     return pos;
                 }
-				link = link.previous;
-			}
-		} else {
-			while (link != voidLink) {
-				pos--;
-				if (link.data == null) {
+                link = link.previous;
+            }
+        } else {
+            while (link != voidLink) {
+                pos--;
+                if (link.data == null) {
                     return pos;
                 }
-				link = link.previous;
-			}
-		}
-		return -1;
-	}
-
-	/**
-	 * Answers a ListIterator on the elements of this LinkedList. The elements
-	 * are iterated in the same order that they occur in the LinkedList. The
-	 * iteration starts at the specified location.
-	 * 
-	 * @param location
-	 *            the index at which to start the iteration
-	 * @return a ListIterator on the elements of this LinkedList
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 * 
-	 * @see ListIterator
-	 */
-	@Override
+                link = link.previous;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Answers a ListIterator on the elements of this LinkedList. The elements
+     * are iterated in the same order that they occur in the LinkedList. The
+     * iteration starts at the specified location.
+     * 
+     * @param location
+     *            the index at which to start the iteration
+     * @return a ListIterator on the elements of this LinkedList
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     * 
+     * @see ListIterator
+     */
+    @Override
     public ListIterator<E> listIterator(int location) {
-		return new LinkIterator<E>(this, location);
-	}
+        return new LinkIterator<E>(this, location);
+    }
 
-	/**
-	 * Removes the object at the specified location from this LinkedList.
-	 * 
-	 * @param location
-	 *            the index of the object to remove
-	 * @return the removed object
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	@Override
+    /**
+     * Removes the object at the specified location from this LinkedList.
+     * 
+     * @param location
+     *            the index of the object to remove
+     * @return the removed object
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    @Override
     public E remove(int location) {
-		if (0 <= location && location < size) {
-			Link<E> link = voidLink;
-			if (location < (size / 2)) {
-				for (int i = 0; i <= location; i++) {
+        if (0 <= location && location < size) {
+            Link<E> link = voidLink;
+            if (location < (size / 2)) {
+                for (int i = 0; i <= location; i++) {
                     link = link.next;
                 }
-			} else {
-				for (int i = size; i > location; i--) {
+            } else {
+                for (int i = size; i > location; i--) {
                     link = link.previous;
                 }
-			}
-			Link<E> previous = link.previous;
-			Link<E> next = link.next;
-			previous.next = next;
-			next.previous = previous;
-			size--;
-			modCount++;
-			return link.data;
-		}
+            }
+            Link<E> previous = link.previous;
+            Link<E> next = link.next;
+            previous.next = next;
+            next.previous = previous;
+            size--;
+            modCount++;
+            return link.data;
+        }
         throw new IndexOutOfBoundsException();
-	}
+    }
 
-	@Override
+    @Override
     public boolean remove(Object object) {
-		Link<E> link = voidLink.next;
-		if (object != null) {
-			while (link != voidLink && !object.equals(link.data)) {
+        Link<E> link = voidLink.next;
+        if (object != null) {
+            while (link != voidLink && !object.equals(link.data)) {
                 link = link.next;
             }
-		} else {
-			while (link != voidLink && link.data != null) {
+        } else {
+            while (link != voidLink && link.data != null) {
                 link = link.next;
             }
-		}
-		if (link == voidLink) {
+        }
+        if (link == voidLink) {
             return false;
         }
-		Link<E> next = link.next;
-		Link<E> previous = link.previous;
-		previous.next = next;
-		next.previous = previous;
-		size--;
-		modCount++;
-		return true;
-	}
-
-	/**
-	 * Removes the first object from this LinkedList.
-	 * 
-	 * @return the removed object
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this LinkedList is empty
-	 */
-	public E removeFirst() {
-		Link<E> first = voidLink.next;
-		if (first != voidLink) {
-			Link<E> next = first.next;
-			voidLink.next = next;
-			next.previous = voidLink;
-			size--;
-			modCount++;
-			return first.data;
-		}
+        Link<E> next = link.next;
+        Link<E> previous = link.previous;
+        previous.next = next;
+        next.previous = previous;
+        size--;
+        modCount++;
+        return true;
+    }
+
+    /**
+     * Removes the first object from this LinkedList.
+     * 
+     * @return the removed object
+     * 
+     * @exception NoSuchElementException
+     *                when this LinkedList is empty
+     */
+    public E removeFirst() {
+        Link<E> first = voidLink.next;
+        if (first != voidLink) {
+            Link<E> next = first.next;
+            voidLink.next = next;
+            next.previous = voidLink;
+            size--;
+            modCount++;
+            return first.data;
+        }
         throw new NoSuchElementException();
-	}
+    }
 
-	/**
-	 * Removes the last object from this LinkedList.
-	 * 
-	 * @return the removed object
-	 * 
-	 * @exception NoSuchElementException
-	 *                when this LinkedList is empty
-	 */
-	public E removeLast() {
-		Link<E> last = voidLink.previous;
-		if (last != voidLink) {
-			Link<E> previous = last.previous;
-			voidLink.previous = previous;
-			previous.next = voidLink;
-			size--;
-			modCount++;
-			return last.data;
-		}
+    /**
+     * Removes the last object from this LinkedList.
+     * 
+     * @return the removed object
+     * 
+     * @exception NoSuchElementException
+     *                when this LinkedList is empty
+     */
+    public E removeLast() {
+        Link<E> last = voidLink.previous;
+        if (last != voidLink) {
+            Link<E> previous = last.previous;
+            voidLink.previous = previous;
+            previous.next = voidLink;
+            size--;
+            modCount++;
+            return last.data;
+        }
         throw new NoSuchElementException();
-	}
+    }
 
-	/**
-	 * Replaces the element at the specified location in this LinkedList with
-	 * the specified object.
-	 * 
-	 * @param location
-	 *            the index at which to put the specified object
-	 * @param object
-	 *            the object to add
-	 * @return the previous element at the index
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	@Override
+    /**
+     * Replaces the element at the specified location in this LinkedList with
+     * the specified object.
+     * 
+     * @param location
+     *            the index at which to put the specified object
+     * @param object
+     *            the object to add
+     * @return the previous element at the index
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    @Override
     public E set(int location, E object) {
-		if (0 <= location && location < size) {
-			Link<E> link = voidLink;
-			if (location < (size / 2)) {
-				for (int i = 0; i <= location; i++) {
+        if (0 <= location && location < size) {
+            Link<E> link = voidLink;
+            if (location < (size / 2)) {
+                for (int i = 0; i <= location; i++) {
                     link = link.next;
                 }
-			} else {
-				for (int i = size; i > location; i--) {
+            } else {
+                for (int i = size; i > location; i--) {
                     link = link.previous;
                 }
-			}
-			E result = link.data;
-			link.data = object;
-			return result;
-		}
+            }
+            E result = link.data;
+            link.data = object;
+            return result;
+        }
         throw new IndexOutOfBoundsException();
-	}
+    }
 
-	/**
-	 * Answers the number of elements in this LinkedList.
-	 * 
-	 * @return the number of elements in this LinkedList
-	 */
-	@Override
+    /**
+     * Answers the number of elements in this LinkedList.
+     * 
+     * @return the number of elements in this LinkedList
+     */
+    @Override
     public int size() {
-		return size;
-	}
-    
+        return size;
+    }
+
     public boolean offer(E o) {
         add(o);
         return true;
@@ -724,79 +725,79 @@
         return getFirst();
     }
 
-	/**
-	 * Answers a new array containing all elements contained in this LinkedList.
-	 * 
-	 * @return an array of the elements from this LinkedList
-	 */
-	@Override
+    /**
+     * Answers a new array containing all elements contained in this LinkedList.
+     * 
+     * @return an array of the elements from this LinkedList
+     */
+    @Override
     public Object[] toArray() {
-		int index = 0;
-		Object[] contents = new Object[size];
-		Link<E> link = voidLink.next;
-		while (link != voidLink) {
-			contents[index++] = link.data;
-			link = link.next;
-		}
-		return contents;
-	}
-
-	/**
-	 * Answers an array containing all elements contained in this LinkedList. If
-	 * the specified array is large enough to hold the elements, the specified
-	 * array is used, otherwise an array of the same type is created. If the
-	 * specified array is used and is larger than this LinkedList, the array
-	 * element following the collection elements is set to null.
-	 * 
-	 * @param contents
-	 *            the array
-	 * @return an array of the elements from this LinkedList
-	 * 
-	 * @exception ArrayStoreException
-	 *                when the type of an element in this LinkedList cannot be
-	 *                stored in the type of the specified array
-	 */
-	@Override
+        int index = 0;
+        Object[] contents = new Object[size];
+        Link<E> link = voidLink.next;
+        while (link != voidLink) {
+            contents[index++] = link.data;
+            link = link.next;
+        }
+        return contents;
+    }
+
+    /**
+     * Answers an array containing all elements contained in this LinkedList. If
+     * the specified array is large enough to hold the elements, the specified
+     * array is used, otherwise an array of the same type is created. If the
+     * specified array is used and is larger than this LinkedList, the array
+     * element following the collection elements is set to null.
+     * 
+     * @param contents
+     *            the array
+     * @return an array of the elements from this LinkedList
+     * 
+     * @exception ArrayStoreException
+     *                when the type of an element in this LinkedList cannot be
+     *                stored in the type of the specified array
+     */
+    @Override
     @SuppressWarnings("unchecked")
     public <T> T[] toArray(T[] contents) {
-		int index = 0;
-		if (size > contents.length) {
+        int index = 0;
+        if (size > contents.length) {
             Class<?> ct = contents.getClass().getComponentType();
             contents = (T[]) Array.newInstance(ct, size);
         }
-		Link<E> link = voidLink.next;
-		while (link != voidLink) {
-			contents[index++] = (T)link.data;
-			link = link.next;
-		}
-		if (index < contents.length) {
+        Link<E> link = voidLink.next;
+        while (link != voidLink) {
+            contents[index++] = (T) link.data;
+            link = link.next;
+        }
+        if (index < contents.length) {
             contents[index] = null;
         }
-		return contents;
-	}
+        return contents;
+    }
 
-	private void writeObject(ObjectOutputStream stream) throws IOException {
-		stream.defaultWriteObject();
-		stream.writeInt(size);
-		Iterator<E> it = iterator();
-		while (it.hasNext()) {
+    private void writeObject(ObjectOutputStream stream) throws IOException {
+        stream.defaultWriteObject();
+        stream.writeInt(size);
+        Iterator<E> it = iterator();
+        while (it.hasNext()) {
             stream.writeObject(it.next());
         }
-	}
+    }
 
-	@SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream stream) throws IOException,
-			ClassNotFoundException {
-		stream.defaultReadObject();
-		size = stream.readInt();
-		voidLink = new Link<E>(null, null, null);
-		Link<E> link = voidLink;
-		for (int i = size; --i >= 0;) {
-			Link<E> nextLink = new Link<E>((E)stream.readObject(), link, null);
-			link.next = nextLink;
-			link = nextLink;
-		}
-		link.next = voidLink;
-		voidLink.previous = link;
-	}
+            ClassNotFoundException {
+        stream.defaultReadObject();
+        size = stream.readInt();
+        voidLink = new Link<E>(null, null, null);
+        Link<E> link = voidLink;
+        for (int i = size; --i >= 0;) {
+            Link<E> nextLink = new Link<E>((E) stream.readObject(), link, null);
+            link.next = nextLink;
+            link = nextLink;
+        }
+        link.next = voidLink;
+        voidLink.previous = link;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java?rev=598631&r1=598630&r2=598631&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/List.java Tue Nov 27 05:14:12 2007
@@ -17,339 +17,339 @@
 
 package java.util;
 
-
 /**
  * List is a collection which maintains an ordering for its elements. Every
  * element in the list has an index.
  */
 public interface List<E> extends Collection<E> {
-	/**
-	 * Inserts the specified object into this Vector at the specified location.
-	 * The object is inserted before any previous element at the specified
-	 * location. If the location is equal to the size of this List, the object
-	 * is added at the end.
-	 * 
-	 * @param location
-	 *            the index at which to insert
-	 * @param object
-	 *            the object to add
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when adding to this List is not supported
-	 * @exception ClassCastException
-	 *                when the class of the object is inappropriate for this
-	 *                List
-	 * @exception IllegalArgumentException
-	 *                when the object cannot be added to this List
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	public void add(int location, E object);
-
-	/**
-	 * Adds the specified object at the end of this List.
-	 * 
-	 * @param object
-	 *            the object to add
-	 * @return true
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when adding to this List is not supported
-	 * @exception ClassCastException
-	 *                when the class of the object is inappropriate for this
-	 *                List
-	 * @exception IllegalArgumentException
-	 *                when the object cannot be added to this List
-	 */
-	public boolean add(E object);
-
-	/**
-	 * Inserts the objects in the specified Collection at the specified location
-	 * in this List. The objects are added in the order they are returned from
-	 * the Collection iterator.
-	 * 
-	 * @param location
-	 *            the index at which to insert
-	 * @param collection
-	 *            the Collection of objects
-	 * @return true if this List is modified, false otherwise
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when adding to this List is not supported
-	 * @exception ClassCastException
-	 *                when the class of an object is inappropriate for this List
-	 * @exception IllegalArgumentException
-	 *                when an object cannot be added to this List
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	public boolean addAll(int location, Collection<? extends E> collection);
-
-	/**
-	 * Adds the objects in the specified Collection to the end of this List. The
-	 * objects are added in the order they are returned from the Collection
-	 * iterator.
-	 * 
-	 * @param collection
-	 *            the Collection of objects
-	 * @return true if this List is modified, false otherwise
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when adding to this List is not supported
-	 * @exception ClassCastException
-	 *                when the class of an object is inappropriate for this List
-	 * @exception IllegalArgumentException
-	 *                when an object cannot be added to this List
-	 */
-	public boolean addAll(Collection<? extends E> collection);
-
-	/**
-	 * Removes all elements from this List, leaving it empty.
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing from this List is not supported
-	 * 
-	 * @see #isEmpty
-	 * @see #size
-	 */
-	public void clear();
-
-	/**
-	 * Searches this List for the specified object.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return true if object is an element of this List, false otherwise
-	 */
-	public boolean contains(Object object);
-
-	/**
-	 * Searches this List for all objects in the specified Collection.
-	 * 
-	 * @param collection
-	 *            the Collection of objects
-	 * @return true if all objects in the specified Collection are elements of
-	 *         this List, false otherwise
-	 */
-	public boolean containsAll(Collection<?> collection);
-
-	/**
-	 * Compares the argument to the receiver, and answers true if they represent
-	 * the <em>same</em> object using a class specific comparison.
-	 * 
-	 * @param object
-	 *            Object the object to compare with this object.
-	 * @return boolean <code>true</code> if the object is the same as this
-	 *         object <code>false</code> if it is different from this object.
-	 * @see #hashCode
-	 */
-	public boolean equals(Object object);
-
-	/**
-	 * Answers the element at the specified location in this List.
-	 * 
-	 * @param location
-	 *            the index of the element to return
-	 * @return the element at the specified location
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	public E get(int location);
-
-	/**
-	 * Answers an integer hash code for the receiver. Objects which are equal
-	 * answer the same value for this method.
-	 * 
-	 * @return the receiver's hash
-	 * 
-	 * @see #equals
-	 */
-	public int hashCode();
-
-	/**
-	 * Searches this List for the specified object and returns the index of the
-	 * first occurrence.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return the index of the first occurrence of the object
-	 */
-	public int indexOf(Object object);
-
-	/**
-	 * Answers if this List has no elements, a size of zero.
-	 * 
-	 * @return true if this List has no elements, false otherwise
-	 * 
-	 * @see #size
-	 */
-	public boolean isEmpty();
-
-	/**
-	 * Answers an Iterator on the elements of this List. The elements are
-	 * iterated in the same order that they occur in the List.
-	 * 
-	 * @return an Iterator on the elements of this List
-	 * 
-	 * @see Iterator
-	 */
-	public Iterator<E> iterator();
-
-	/**
-	 * Searches this List for the specified object and returns the index of the
-	 * last occurrence.
-	 * 
-	 * @param object
-	 *            the object to search for
-	 * @return the index of the last occurrence of the object
-	 */
-	public int lastIndexOf(Object object);
-
-	/**
-	 * Answers a ListIterator on the elements of this List. The elements are
-	 * iterated in the same order that they occur in the List.
-	 * 
-	 * @return a ListIterator on the elements of this List
-	 * 
-	 * @see ListIterator
-	 */
-	public ListIterator<E> listIterator();
-
-	/**
-	 * Answers a ListIterator on the elements of this List. The elements are
-	 * iterated in the same order that they occur in the List. The iteration
-	 * starts at the specified location.
-	 * 
-	 * @param location
-	 *            the index at which to start the iteration
-	 * @return a ListIterator on the elements of this List
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 * 
-	 * @see ListIterator
-	 */
-	public ListIterator<E> listIterator(int location);
-
-	/**
-	 * Removes the object at the specified location from this List.
-	 * 
-	 * @param location
-	 *            the index of the object to remove
-	 * @return the removed object
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing from this List is not supported
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	public E remove(int location);
-
-	/**
-	 * Removes the first occurrence of the specified object from this List.
-	 * 
-	 * @param object
-	 *            the object to remove
-	 * @return true if this List is modified, false otherwise
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing from this List is not supported
-	 */
-	public boolean remove(Object object);
-
-	/**
-	 * Removes all occurrences in this List of each object in the specified
-	 * Collection.
-	 * 
-	 * @param collection
-	 *            the Collection of objects to remove
-	 * @return true if this List is modified, false otherwise
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing from this List is not supported
-	 */
-	public boolean removeAll(Collection<?> collection);
-
-	/**
-	 * Removes all objects from this List that are not contained in the
-	 * specified Collection.
-	 * 
-	 * @param collection
-	 *            the Collection of objects to retain
-	 * @return true if this List is modified, false otherwise
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when removing from this List is not supported
-	 */
-	public boolean retainAll(Collection<?> collection);
-
-	/**
-	 * Replaces the element at the specified location in this List with the
-	 * specified object.
-	 * 
-	 * @param location
-	 *            the index at which to put the specified object
-	 * @param object
-	 *            the object to add
-	 * @return the previous element at the index
-	 * 
-	 * @exception UnsupportedOperationException
-	 *                when replacing elements in this List is not supported
-	 * @exception ClassCastException
-	 *                when the class of an object is inappropriate for this List
-	 * @exception IllegalArgumentException
-	 *                when an object cannot be added to this List
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>location < 0 || >= size()</code>
-	 */
-	public E set(int location, E object);
-
-	/**
-	 * Answers the number of elements in this List.
-	 * 
-	 * @return the number of elements in this List
-	 */
-	public int size();
-
-	/**
-	 * Answers a List of the specified portion of this List from the start index
-	 * to one less than the end index. The returned List is backed by this list
-	 * so changes to one are reflected by the other.
-	 * 
-	 * @param start
-	 *            the index at which to start the sublist
-	 * @param end
-	 *            the index one past the end of the sublist
-	 * @return a List of a portion of this List
-	 * 
-	 * @exception IndexOutOfBoundsException
-	 *                when <code>start < 0, start > end</code> or
-	 *                <code>end > size()</code>
-	 */
-	public List<E> subList(int start, int end);
-
-	/**
-	 * Answers an array containing all elements contained in this List.
-	 * 
-	 * @return an array of the elements from this List
-	 */
-	public Object[] toArray();
-
-	/**
-	 * Answers an array containing all elements contained in this List. If the
-	 * specified array is large enough to hold the elements, the specified array
-	 * is used, otherwise an array of the same type is created. If the specified
-	 * array is used and is larger than this List, the array element following
-	 * the collection elements is set to null.
-	 * 
-	 * @param array
-	 *            the array
-	 * @return an array of the elements from this List
-	 * 
-	 * @exception ArrayStoreException
-	 *                when the type of an element in this List cannot be stored
-	 *                in the type of the specified array
-	 */
-	public <T> T[] toArray(T[] array);
+
+    /**
+     * Inserts the specified object into this Vector at the specified location.
+     * The object is inserted before any previous element at the specified
+     * location. If the location is equal to the size of this List, the object
+     * is added at the end.
+     * 
+     * @param location
+     *            the index at which to insert
+     * @param object
+     *            the object to add
+     * 
+     * @exception UnsupportedOperationException
+     *                when adding to this List is not supported
+     * @exception ClassCastException
+     *                when the class of the object is inappropriate for this
+     *                List
+     * @exception IllegalArgumentException
+     *                when the object cannot be added to this List
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    public void add(int location, E object);
+
+    /**
+     * Adds the specified object at the end of this List.
+     * 
+     * @param object
+     *            the object to add
+     * @return true
+     * 
+     * @exception UnsupportedOperationException
+     *                when adding to this List is not supported
+     * @exception ClassCastException
+     *                when the class of the object is inappropriate for this
+     *                List
+     * @exception IllegalArgumentException
+     *                when the object cannot be added to this List
+     */
+    public boolean add(E object);
+
+    /**
+     * Inserts the objects in the specified Collection at the specified location
+     * in this List. The objects are added in the order they are returned from
+     * the Collection iterator.
+     * 
+     * @param location
+     *            the index at which to insert
+     * @param collection
+     *            the Collection of objects
+     * @return true if this List is modified, false otherwise
+     * 
+     * @exception UnsupportedOperationException
+     *                when adding to this List is not supported
+     * @exception ClassCastException
+     *                when the class of an object is inappropriate for this List
+     * @exception IllegalArgumentException
+     *                when an object cannot be added to this List
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    public boolean addAll(int location, Collection<? extends E> collection);
+
+    /**
+     * Adds the objects in the specified Collection to the end of this List. The
+     * objects are added in the order they are returned from the Collection
+     * iterator.
+     * 
+     * @param collection
+     *            the Collection of objects
+     * @return true if this List is modified, false otherwise
+     * 
+     * @exception UnsupportedOperationException
+     *                when adding to this List is not supported
+     * @exception ClassCastException
+     *                when the class of an object is inappropriate for this List
+     * @exception IllegalArgumentException
+     *                when an object cannot be added to this List
+     */
+    public boolean addAll(Collection<? extends E> collection);
+
+    /**
+     * Removes all elements from this List, leaving it empty.
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing from this List is not supported
+     * 
+     * @see #isEmpty
+     * @see #size
+     */
+    public void clear();
+
+    /**
+     * Searches this List for the specified object.
+     * 
+     * @param object
+     *            the object to search for
+     * @return true if object is an element of this List, false otherwise
+     */
+    public boolean contains(Object object);
+
+    /**
+     * Searches this List for all objects in the specified Collection.
+     * 
+     * @param collection
+     *            the Collection of objects
+     * @return true if all objects in the specified Collection are elements of
+     *         this List, false otherwise
+     */
+    public boolean containsAll(Collection<?> collection);
+
+    /**
+     * Compares the argument to the receiver, and answers true if they represent
+     * the <em>same</em> object using a class specific comparison.
+     * 
+     * @param object
+     *            Object the object to compare with this object.
+     * @return boolean <code>true</code> if the object is the same as this
+     *         object <code>false</code> if it is different from this object.
+     * @see #hashCode
+     */
+    public boolean equals(Object object);
+
+    /**
+     * Answers the element at the specified location in this List.
+     * 
+     * @param location
+     *            the index of the element to return
+     * @return the element at the specified location
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    public E get(int location);
+
+    /**
+     * Answers an integer hash code for the receiver. Objects which are equal
+     * answer the same value for this method.
+     * 
+     * @return the receiver's hash
+     * 
+     * @see #equals
+     */
+    public int hashCode();
+
+    /**
+     * Searches this List for the specified object and returns the index of the
+     * first occurrence.
+     * 
+     * @param object
+     *            the object to search for
+     * @return the index of the first occurrence of the object
+     */
+    public int indexOf(Object object);
+
+    /**
+     * Answers if this List has no elements, a size of zero.
+     * 
+     * @return true if this List has no elements, false otherwise
+     * 
+     * @see #size
+     */
+    public boolean isEmpty();
+
+    /**
+     * Answers an Iterator on the elements of this List. The elements are
+     * iterated in the same order that they occur in the List.
+     * 
+     * @return an Iterator on the elements of this List
+     * 
+     * @see Iterator
+     */
+    public Iterator<E> iterator();
+
+    /**
+     * Searches this List for the specified object and returns the index of the
+     * last occurrence.
+     * 
+     * @param object
+     *            the object to search for
+     * @return the index of the last occurrence of the object
+     */
+    public int lastIndexOf(Object object);
+
+    /**
+     * Answers a ListIterator on the elements of this List. The elements are
+     * iterated in the same order that they occur in the List.
+     * 
+     * @return a ListIterator on the elements of this List
+     * 
+     * @see ListIterator
+     */
+    public ListIterator<E> listIterator();
+
+    /**
+     * Answers a ListIterator on the elements of this List. The elements are
+     * iterated in the same order that they occur in the List. The iteration
+     * starts at the specified location.
+     * 
+     * @param location
+     *            the index at which to start the iteration
+     * @return a ListIterator on the elements of this List
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     * 
+     * @see ListIterator
+     */
+    public ListIterator<E> listIterator(int location);
+
+    /**
+     * Removes the object at the specified location from this List.
+     * 
+     * @param location
+     *            the index of the object to remove
+     * @return the removed object
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing from this List is not supported
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    public E remove(int location);
+
+    /**
+     * Removes the first occurrence of the specified object from this List.
+     * 
+     * @param object
+     *            the object to remove
+     * @return true if this List is modified, false otherwise
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing from this List is not supported
+     */
+    public boolean remove(Object object);
+
+    /**
+     * Removes all occurrences in this List of each object in the specified
+     * Collection.
+     * 
+     * @param collection
+     *            the Collection of objects to remove
+     * @return true if this List is modified, false otherwise
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing from this List is not supported
+     */
+    public boolean removeAll(Collection<?> collection);
+
+    /**
+     * Removes all objects from this List that are not contained in the
+     * specified Collection.
+     * 
+     * @param collection
+     *            the Collection of objects to retain
+     * @return true if this List is modified, false otherwise
+     * 
+     * @exception UnsupportedOperationException
+     *                when removing from this List is not supported
+     */
+    public boolean retainAll(Collection<?> collection);
+
+    /**
+     * Replaces the element at the specified location in this List with the
+     * specified object.
+     * 
+     * @param location
+     *            the index at which to put the specified object
+     * @param object
+     *            the object to add
+     * @return the previous element at the index
+     * 
+     * @exception UnsupportedOperationException
+     *                when replacing elements in this List is not supported
+     * @exception ClassCastException
+     *                when the class of an object is inappropriate for this List
+     * @exception IllegalArgumentException
+     *                when an object cannot be added to this List
+     * @exception IndexOutOfBoundsException
+     *                when <code>location < 0 || >= size()</code>
+     */
+    public E set(int location, E object);
+
+    /**
+     * Answers the number of elements in this List.
+     * 
+     * @return the number of elements in this List
+     */
+    public int size();
+
+    /**
+     * Answers a List of the specified portion of this List from the start index
+     * to one less than the end index. The returned List is backed by this list
+     * so changes to one are reflected by the other.
+     * 
+     * @param start
+     *            the index at which to start the sublist
+     * @param end
+     *            the index one past the end of the sublist
+     * @return a List of a portion of this List
+     * 
+     * @exception IndexOutOfBoundsException
+     *                when <code>start < 0, start > end</code> or
+     *                <code>end > size()</code>
+     */
+    public List<E> subList(int start, int end);
+
+    /**
+     * Answers an array containing all elements contained in this List.
+     * 
+     * @return an array of the elements from this List
+     */
+    public Object[] toArray();
+
+    /**
+     * Answers an array containing all elements contained in this List. If the
+     * specified array is large enough to hold the elements, the specified array
+     * is used, otherwise an array of the same type is created. If the specified
+     * array is used and is larger than this List, the array element following
+     * the collection elements is set to null.
+     * 
+     * @param array
+     *            the array
+     * @return an array of the elements from this List
+     * 
+     * @exception ArrayStoreException
+     *                when the type of an element in this List cannot be stored
+     *                in the type of the specified array
+     */
+    public <T> T[] toArray(T[] array);
 }



Mime
View raw message