net.walend.collection
Interface MutableList

All Superinterfaces:
Collection, HasState, List, MutableCollection
All Known Implementing Classes:
MutableArrayList

public interface MutableList
extends MutableCollection, List

add() appends the object to the end of the list. addAll() appends all of the objects to the end of the list.

Since:
20010908
Author:
David Walend

Field Summary
 
Fields inherited from interface net.walend.collection.List
EMPTY
 
Method Summary
 boolean add(int index, java.lang.Object ob)
          Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
 boolean addAll(int index, Collection col)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
 java.lang.Object remove(int index)
          Removes and returns the object at index in this list.
 java.lang.Object set(int index, java.lang.Object ob)
          Replaces the element at the specified position in this list with the specified element
 
Methods inherited from interface net.walend.collection.MutableCollection
add, addAll, clear, remove, removeAll, retainAll
 
Methods inherited from interface net.walend.collection.Collection
contains, containsAll, getIdentitor, getJavaCollection, isEmpty, iterator, sameContentsAs, size
 
Methods inherited from interface net.walend.collection.HasState
getPrincipleInterface, sameStateAs
 
Methods inherited from interface net.walend.collection.List
get, getJavaList, indexOf, indexOfSubList, lastIndexOf, listIterator, listIterator, sameListAs
 

Method Detail

add

public boolean add(int index,
                   java.lang.Object ob)
Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Returns:
true
Throws:
java.lang.IndexOutOfBoundsException - if the index is not in the list.

addAll

public boolean addAll(int index,
                      Collection col)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Returns:
true
Throws:
java.lang.IndexOutOfBoundsException - if the index is not in the list.

remove

public java.lang.Object remove(int index)
Removes and returns the object at index in this list. Shifts any following elements forward in the list.

Returns:
the object removed from the list.
Throws:
java.lang.IndexOutOfBoundsException - if the index is not in the list.

set

public java.lang.Object set(int index,
                            java.lang.Object ob)
Replaces the element at the specified position in this list with the specified element

Returns:
the object that was at index.
Throws:
java.lang.IndexOutOfBoundsException - if the index is not in the list.


Copyright (c) 2000, 2001, David Walend