Back to index

plt-scheme  4.2.1
Public Member Functions | Protected Member Functions | Protected Attributes | Package Functions | Static Package Functions | Package Attributes
java.util.RandomAccessSubList Class Reference

This class is a RandomAccess version of SubList, as required by AbstractList#subList(int, int). More...

Inheritance diagram for java.util.RandomAccessSubList:
Inheritance graph
[legend]
Collaboration diagram for java.util.RandomAccessSubList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int size ()
 Specified by AbstractList.subList to return the private field size.
boolean contains (Object o)
 Test whether this collection contains a given object.
boolean containsAll (Collection c)
 Tests whether this collection contains all the elements in a given collection.
boolean isEmpty ()
 Test whether this collection is empty.
boolean remove (Object o)
 Remove a single instance of an object from this collection (optional operation).
Object remove (int index)
 Specified by AbstractList.subList to delegate to the backing list.
boolean removeAll (Collection c)
 Remove from this collection all its elements that are contained in a given collection (optional operation).
boolean retainAll (Collection c)
 Remove from this collection all its elements that are not contained in a given collection (optional operation).
Object[] toArray ()
 Return an array containing the elements of this collection.
Object[] toArray (Object[] o)
 Copy the collection into a given array if it will fit, or into a dynamically created array of the same run-time type as the given array if not.
Object set (int index, Object o)
 Specified by AbstractList.subList to delegate to the backing list.
Object get (int index)
 Specified by AbstractList.subList to delegate to the backing list.
void add (int index, Object o)
 Specified by AbstractList.subList to delegate to the backing list.
boolean add (Object o)
 Add an element to the end of the list (optional operation).
boolean addAll (int index, Collection c)
 Specified by AbstractList.subList to delegate to the backing list.
boolean addAll (Collection c)
 Specified by AbstractList.subList to return addAll(size, c).
Iterator iterator ()
 Specified by AbstractList.subList to return listIterator().
ListIterator listIterator (final int index)
ListIterator listIterator ()
 Obtain a ListIterator over this list, starting at the beginning.
ListIterator listIterator (int index)
 Obtain a ListIterator over this list, starting at a given position.
void clear ()
 Clear the list, such that a subsequent call to isEmpty() would return true (optional operation).
boolean equals (Object o)
 Test whether this list is equal to another object.
int hashCode ()
 Obtains a hash code for this list.
int indexOf (Object o)
 Obtain the first index at which a given object is to be found in this list.
int lastIndexOf (Object o)
 Obtain the last index at which a given object is to be found in this list.
List subList (int fromIndex, int toIndex)
 Obtain a List view of a subsection of this list, from fromIndex (inclusive) to toIndex (exclusive).
String toString ()
 Creates a String representation of the Collection.

Protected Member Functions

void removeRange (int fromIndex, int toIndex)
 Specified by AbstractList.subList to delegate to the backing list.

Protected Attributes

int modCount
 A count of the number of structural modifications that have been made to the list (that is, insertions and removals).

Package Functions

 RandomAccessSubList (AbstractList backing, int fromIndex, int toIndex)
 Construct the sublist.
void checkMod ()
 This method checks the two modCount fields to ensure that there has not been a concurrent modification, returning if all is okay.
boolean removeAllInternal (Collection c)
 Remove from this collection all its elements that are contained in a given collection (optional operation).
boolean retainAllInternal (Collection c)
 Remove from this collection all its elements that are not contained in a given collection (optional operation).

Static Package Functions

static final boolean equals (Object o1, Object o2)
 Compare two objects according to Collection semantics.
static final int hashCode (Object o)
 Hash an object according to Collection semantics.

Package Attributes

AbstractList backingList
 The original list.
int offset
 The index of the first element of the sublist.
int size
 The size of the sublist.

Detailed Description

This class is a RandomAccess version of SubList, as required by AbstractList#subList(int, int).

Author:
Eric Blake ebb9@.nosp@m.emai.nosp@m.l.byu.nosp@m..edu

Definition at line 959 of file AbstractList.java.


Constructor & Destructor Documentation

java.util.RandomAccessSubList.RandomAccessSubList ( AbstractList  backing,
int  fromIndex,
int  toIndex 
) [inline, package]

Construct the sublist.

Parameters:
backingthe list this comes from
fromIndexthe lower bound, inclusive
toIndexthe upper bound, exclusive

Definition at line 970 of file AbstractList.java.

  {
    super(backing, fromIndex, toIndex);
  }

Member Function Documentation

boolean java.util.AbstractList.add ( Object  o) [inline, inherited]

Add an element to the end of the list (optional operation).

If the list imposes restraints on what can be inserted, such as no null elements, this should be documented. This implementation calls add(size(), o);, and will fail if that version does.

Parameters:
othe object to add
Returns:
true, as defined by Collection for a modified list
Exceptions:
UnsupportedOperationExceptionif this list does not support the add operation
ClassCastExceptionif o cannot be added to this list due to its type
IllegalArgumentExceptionif o cannot be added to this list for some other reason
See also:
add(int, Object)

Reimplemented from java.util.AbstractCollection.

Definition at line 158 of file AbstractList.java.

  {
    add(size(), o);
    return true;
  }

Here is the call graph for this function:

void java.util.SubList.add ( int  index,
Object  o 
) [inline, inherited]

Specified by AbstractList.subList to delegate to the backing list.

Parameters:
indexthe index to insert at
othe object to add

Reimplemented from java.util.AbstractList.

Definition at line 767 of file AbstractList.java.

Here is the call graph for this function:

boolean java.util.SubList.addAll ( int  index,
Collection  c 
) [inline, inherited]

Specified by AbstractList.subList to delegate to the backing list.

Parameters:
indexthe location to insert at
cthe collection to insert
Returns:
true if this list was modified, in other words, c is non-empty

Reimplemented from java.util.AbstractList.

Definition at line 816 of file AbstractList.java.

  {
    checkMod();
    checkBoundsInclusive(index);
    int csize = c.size();
    boolean result = backingList.addAll(offset + index, c);
    size += csize;
    modCount = backingList.modCount;
    return result;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean java.util.SubList.addAll ( Collection  c) [inline, inherited]

Specified by AbstractList.subList to return addAll(size, c).

Parameters:
cthe collection to insert
Returns:
true if this list was modified, in other words, c is non-empty

Reimplemented from java.util.AbstractList.

Definition at line 833 of file AbstractList.java.

  {
    return addAll(size, c);
  }

Here is the call graph for this function:

void java.util.SubList.checkMod ( ) [inline, package, inherited]

This method checks the two modCount fields to ensure that there has not been a concurrent modification, returning if all is okay.

Exceptions:
ConcurrentModificationExceptionif the backing list has been modified externally to this sublist

Definition at line 687 of file AbstractList.java.

  {
    if (modCount != backingList.modCount)
      throw new ConcurrentModificationException();
  }

Here is the caller graph for this function:

void java.util.AbstractList.clear ( ) [inline, inherited]

Clear the list, such that a subsequent call to isEmpty() would return true (optional operation).

This implementation calls removeRange(0, size()), so it will fail unless remove or removeRange is overridden.

Exceptions:
UnsupportedOperationExceptionif this list does not support the clear operation
See also:
remove(int)
removeRange(int, int)

Reimplemented from java.util.AbstractCollection.

Definition at line 209 of file AbstractList.java.

  {
    removeRange(0, size());
  }

Here is the call graph for this function:

boolean java.util.SubList.contains ( Object  o) [inline, inherited]

Test whether this collection contains a given object.

That is, if the collection has an element e such that (o == null ? e == null : o.equals(e)). This implementation obtains an iterator over the collection and iterates over it, testing each element for equality with the given object. If it is equal, true is returned. Otherwise false is returned when the end of the collection is reached.

Parameters:
othe object to remove from this collection
Returns:
true if this collection contains an object equal to o

Reimplemented from java.util.AbstractList.

Definition at line 655 of file AbstractList.java.

{ return super.contains(o); }
boolean java.util.SubList.containsAll ( Collection  c) [inline, inherited]

Tests whether this collection contains all the elements in a given collection.

This implementation iterates over the given collection, testing whether each element is contained in this collection. If any one is not, false is returned. Otherwise true is returned.

Parameters:
cthe collection to test against
Returns:
true if this collection contains all the elements in the given collection
Exceptions:
NullPointerExceptionif the given collection is null
See also:
contains(Object)

Reimplemented from java.util.AbstractList.

Definition at line 656 of file AbstractList.java.

{ return super.containsAll(c); }
boolean java.util.AbstractList.equals ( Object  o) [inline, inherited]

Test whether this list is equal to another object.

A List is defined to be equal to an object if and only if that object is also a List, and the two lists have the same sequence. Two lists l1 and l2 are equal if and only if l1.size() == l2.size(), and for every integer n between 0 and l1.size() - 1 inclusive, l1.get(n) == null ? l2.get(n) == null : l1.get(n).equals(l2.get(n)).

This implementation returns true if the object is this, or false if the object is not a List. Otherwise, it iterates over both lists (with iterator()), returning false if two elements compare false or one list is shorter, and true if the iteration completes successfully.

Parameters:
othe object to test for equality with this list
Returns:
true if o is equal to this list
See also:
Object::equals(Object)
hashCode()

Definition at line 233 of file AbstractList.java.

  {
    if (o == this)
      return true;
    if (! (o instanceof List))
      return false;
    int size = size();
    if (size != ((List) o).size())
      return false;

    Iterator itr1 = iterator();
    Iterator itr2 = ((List) o).iterator();

    while (--size >= 0)
      if (! AbstractCollection.equals(itr1.next(), itr2.next()))
        return false;
    return true;
  }

Here is the call graph for this function:

static final boolean java.util.AbstractCollection.equals ( Object  o1,
Object  o2 
) [inline, static, package, inherited]

Compare two objects according to Collection semantics.

Parameters:
o1the first object
o2the second object
Returns:
o1 == null ? o2 == null : o1.equals(o2)

Definition at line 446 of file AbstractCollection.java.

  {
    return o1 == null ? o2 == null : o1.equals(o2);
  }

Here is the caller graph for this function:

Object java.util.SubList.get ( int  index) [inline, virtual, inherited]

Specified by AbstractList.subList to delegate to the backing list.

Parameters:
indexthe location to get from
Returns:
the object at that location

Implements java.util.AbstractList.

Definition at line 754 of file AbstractList.java.

  {
    checkMod();
    checkBoundsExclusive(index);
    return backingList.get(index + offset);
  }

Here is the call graph for this function:

int java.util.AbstractList.hashCode ( ) [inline, inherited]

Obtains a hash code for this list.

In order to obey the general contract of the hashCode method of class Object, this value is calculated as follows:

hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext())
{
  Object obj = i.next();
  hashCode = 31 * hashCode + (obj == null ? 0 : obj.hashCode());
}

This ensures that the general contract of Object.hashCode() is adhered to.

Returns:
the hash code of this list
See also:
Object::hashCode()
equals(Object)

Definition at line 272 of file AbstractList.java.

  {
    int hashCode = 1;
    Iterator itr = iterator();
    int pos = size();
    while (--pos >= 0)
      hashCode = 31 * hashCode + AbstractCollection.hashCode(itr.next());
    return hashCode;
  }

Here is the call graph for this function:

static final int java.util.AbstractCollection.hashCode ( Object  o) [inline, static, package, inherited]

Hash an object according to Collection semantics.

Parameters:
othe object to hash
Returns:
o1 == null ? 0 : o1.hashCode()

Definition at line 459 of file AbstractCollection.java.

  {
    return o == null ? 0 : o.hashCode();
  }

Here is the caller graph for this function:

int java.util.AbstractList.indexOf ( Object  o) [inline, inherited]

Obtain the first index at which a given object is to be found in this list.

This implementation follows a listIterator() until a match is found, or returns -1 if the list end is reached.

Parameters:
othe object to search for
Returns:
the least integer n such that o == null ? get(n) == null : o.equals(get(n)), or -1 if there is no such index

Implements java.util.List.

Definition at line 291 of file AbstractList.java.

  {
    ListIterator itr = listIterator();
    int size = size();
    for (int pos = 0; pos < size; pos++)
      if (AbstractCollection.equals(o, itr.next()))
        return pos;
    return -1;
  }

Here is the call graph for this function:

boolean java.util.SubList.isEmpty ( ) [inline, inherited]

Test whether this collection is empty.

This implementation returns size() == 0.

Returns:
true if this collection is empty.
See also:
size()

Reimplemented from java.util.AbstractList.

Definition at line 657 of file AbstractList.java.

{ return super.isEmpty(); }
Iterator java.util.SubList.iterator ( ) [inline, virtual, inherited]

Specified by AbstractList.subList to return listIterator().

Returns:
an iterator over the sublist

Reimplemented from java.util.AbstractList.

Definition at line 843 of file AbstractList.java.

  {
    return ((Iterator) ((Object) listIterator()));
  }

Here is the call graph for this function:

int java.util.AbstractList.lastIndexOf ( Object  o) [inline, inherited]

Obtain the last index at which a given object is to be found in this list.

This implementation grabs listIterator(size()), then searches backwards for a match or returns -1.

Returns:
the greatest integer n such that o == null ? get(n) == null : o.equals(get(n)), or -1 if there is no such index

Implements java.util.List.

Definition at line 370 of file AbstractList.java.

  {
    int pos = size();
    ListIterator itr = listIterator(pos);
    while (--pos >= 0)
      if (AbstractCollection.equals(o, itr.previous()))
        return pos;
    return -1;
  }

Here is the call graph for this function:

Obtain a ListIterator over this list, starting at a given position.

A first call to next() would return the same as get(index), and a first call to previous() would return the same as get(index - 1).

Parameters:
indexthe position, between 0 and size() inclusive, to begin the iteration from
Returns:
a ListIterator over the elements of this list, in order, starting at index
Exceptions:
IndexOutOfBoundsExceptionif index < 0 || index > size()

Implemented in java.util.AbstractSequentialList.

Obtain a ListIterator over this list, starting at the beginning.

This implementation returns listIterator(0).

Returns:
a ListIterator over the elements of this list, in order, starting at the beginning

Implements java.util.List.

Definition at line 387 of file AbstractList.java.

  {
    return listIterator(0);
  }

Here is the caller graph for this function:

ListIterator java.util.SubList.listIterator ( final int  index) [inline, inherited]

Reimplemented from java.util.AbstractList.

Definition at line 944 of file AbstractList.java.

  {
    checkMod();
    checkBoundsInclusive(index);

    return new SLListIterator(index);
  }

Here is the call graph for this function:

boolean java.util.SubList.remove ( Object  o) [inline, inherited]

Remove a single instance of an object from this collection (optional operation).

That is, remove one element e such that (o == null ? e == null : o.equals(e)), if such an element exists. This implementation obtains an iterator over the collection and iterates over it, testing each element for equality with the given object. If it is equal, it is removed by the iterator's remove method (thus this method will fail with an UnsupportedOperationException if the Iterator's remove method does). After the first element has been removed, true is returned; if the end of the collection is reached, false is returned.

Parameters:
othe object to remove from this collection
Returns:
true if the remove operation caused the Collection to change, or equivalently if the collection did contain o.
Exceptions:
UnsupportedOperationExceptionif this collection's Iterator does not support the remove method
See also:
Iterator::remove()

Reimplemented from java.util.AbstractList.

Definition at line 658 of file AbstractList.java.

{ return super.remove(o); }
Object java.util.SubList.remove ( int  index) [inline, inherited]

Specified by AbstractList.subList to delegate to the backing list.

Parameters:
indexthe index to remove
Returns:
the removed object

Reimplemented from java.util.AbstractList.

Definition at line 782 of file AbstractList.java.

  {
    checkMod();
    checkBoundsExclusive(index);
    Object o = backingList.remove(index + offset);
    size--;
    modCount = backingList.modCount;
    return o;
  }

Here is the call graph for this function:

boolean java.util.SubList.removeAll ( Collection  c) [inline, inherited]

Remove from this collection all its elements that are contained in a given collection (optional operation).

This implementation iterates over this collection, and for each element tests if it is contained in the given collection. If so, it is removed by the Iterator's remove method (thus this method will fail with an UnsupportedOperationException if the Iterator's remove method does).

Parameters:
cthe collection to remove the elements of
Returns:
true if the remove operation caused the Collection to change
Exceptions:
UnsupportedOperationExceptionif this collection's Iterator does not support the remove method
See also:
Iterator::remove()

Reimplemented from java.util.AbstractList.

Definition at line 659 of file AbstractList.java.

{ return super.removeAll(c); }

Remove from this collection all its elements that are contained in a given collection (optional operation).

This implementation iterates over this collection, and for each element tests if it is contained in the given collection. If so, it is removed by the Iterator's remove method (thus this method will fail with an UnsupportedOperationException if the Iterator's remove method does). This method is necessary for ArrayList, which cannot publicly override removeAll but can optimize this call.

Parameters:
cthe collection to remove the elements of
Returns:
true if the remove operation caused the Collection to change
Exceptions:
UnsupportedOperationExceptionif this collection's Iterator does not support the remove method
See also:
Iterator::remove()

Definition at line 293 of file AbstractCollection.java.

  {
    Iterator itr = iterator();
    boolean modified = false;
    int pos = size();
    while (--pos >= 0)
      if (c.contains(itr.next()))
        {
          itr.remove();
          modified = true;
        }
    return modified;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void java.util.SubList.removeRange ( int  fromIndex,
int  toIndex 
) [inline, protected, inherited]

Specified by AbstractList.subList to delegate to the backing list.

This does no bounds checking, as it assumes it will only be called by trusted code like clear() which has already checked the bounds.

Parameters:
fromIndexthe lower bound, inclusive
toIndexthe upper bound, exclusive

Reimplemented from java.util.AbstractList.

Definition at line 800 of file AbstractList.java.

  {
    checkMod();

    backingList.removeRange(offset + fromIndex, offset + toIndex);
    size -= toIndex - fromIndex;
    modCount = backingList.modCount;
  }

Here is the call graph for this function:

boolean java.util.SubList.retainAll ( Collection  c) [inline, inherited]

Remove from this collection all its elements that are not contained in a given collection (optional operation).

This implementation iterates over this collection, and for each element tests if it is contained in the given collection. If not, it is removed by the Iterator's remove method (thus this method will fail with an UnsupportedOperationException if the Iterator's remove method does).

Parameters:
cthe collection to retain the elements of
Returns:
true if the remove operation caused the Collection to change
Exceptions:
UnsupportedOperationExceptionif this collection's Iterator does not support the remove method
See also:
Iterator::remove()

Reimplemented from java.util.AbstractList.

Definition at line 660 of file AbstractList.java.

{ return super.retainAll(c); }

Remove from this collection all its elements that are not contained in a given collection (optional operation).

This implementation iterates over this collection, and for each element tests if it is contained in the given collection. If not, it is removed by the Iterator's remove method (thus this method will fail with an UnsupportedOperationException if the Iterator's remove method does). This method is necessary for ArrayList, which cannot publicly override retainAll but can optimize this call.

Parameters:
cthe collection to retain the elements of
Returns:
true if the remove operation caused the Collection to change
Exceptions:
UnsupportedOperationExceptionif this collection's Iterator does not support the remove method
See also:
Iterator::remove()

Definition at line 342 of file AbstractCollection.java.

  {
    Iterator itr = iterator();
    boolean modified = false;
    int pos = size();
    while (--pos >= 0)
      if (!c.contains(itr.next()))
        {
          itr.remove();
          modified = true;
        }
    return modified;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Object java.util.SubList.set ( int  index,
Object  o 
) [inline, inherited]

Specified by AbstractList.subList to delegate to the backing list.

Parameters:
indexthe location to modify
othe new value
Returns:
the old value

Reimplemented from java.util.AbstractList.

Definition at line 741 of file AbstractList.java.

  {
    checkMod();
    checkBoundsExclusive(index);
    return backingList.set(index + offset, o);
  }

Here is the call graph for this function:

int java.util.SubList.size ( ) [inline, virtual, inherited]

Specified by AbstractList.subList to return the private field size.

Returns:
the sublist size

Implements java.util.AbstractList.

Definition at line 728 of file AbstractList.java.

  {
    checkMod();
    return size;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

List java.util.AbstractList.subList ( int  fromIndex,
int  toIndex 
) [inline, inherited]

Obtain a List view of a subsection of this list, from fromIndex (inclusive) to toIndex (exclusive).

If the two indices are equal, the sublist is empty. The returned list should be modifiable if and only if this list is modifiable. Changes to the returned list should be reflected in this list. If this list is structurally modified in any way other than through the returned list, the result of any subsequent operations on the returned list is undefined.

This implementation returns a subclass of AbstractList. It stores, in private fields, the offset and size of the sublist, and the expected modCount of the backing list. If the backing list implements RandomAccess, the sublist will also.

The subclass's set(int, Object), get(int), add(int, Object), remove(int), addAll(int, Collection) and removeRange(int, int) methods all delegate to the corresponding methods on the backing abstract list, after bounds-checking the index and adjusting for the offset. The addAll(Collection c) method merely returns addAll(size, c). The listIterator(int) method returns a "wrapper object" over a list iterator on the backing list, which is created with the corresponding method on the backing list. The iterator() method merely returns listIterator(), and the size() method merely returns the subclass's size field.

All methods first check to see if the actual modCount of the backing list is equal to its expected value, and throw a ConcurrentModificationException if it is not.

Parameters:
fromIndexthe index that the returned list should start from (inclusive)
toIndexthe index that the returned list should go to (exclusive)
Returns:
a List backed by a subsection of this list
Exceptions:
IndexOutOfBoundsExceptionif fromIndex < 0 || toIndex > size()
IllegalArgumentExceptionif fromIndex > toIndex
See also:
ConcurrentModificationException
RandomAccess

Implements java.util.List.

Definition at line 620 of file AbstractList.java.

  {
    // This follows the specification of AbstractList, but is inconsistent
    // with the one in List. Don't you love Sun's inconsistencies?
    if (fromIndex > toIndex)
      throw new IllegalArgumentException(fromIndex + " > " + toIndex);
    if (fromIndex < 0 || toIndex > size())
      throw new IndexOutOfBoundsException();

    if (((Object) this) instanceof RandomAccess)
      return new RandomAccessSubList(this, fromIndex, toIndex);
    return new SubList(this, fromIndex, toIndex);
  }

Here is the call graph for this function:

Object [] java.util.SubList.toArray ( ) [inline, inherited]

Return an array containing the elements of this collection.

This implementation creates an Object array of size size() and then iterates over the collection, setting each element of the array from the value returned by the iterator. The returned array is safe, and is not backed by the collection.

Returns:
an array containing the elements of this collection

Reimplemented from java.util.AbstractList.

Definition at line 661 of file AbstractList.java.

{ return super.toArray(); }
Object [] java.util.SubList.toArray ( Object[]  a) [inline, inherited]

Copy the collection into a given array if it will fit, or into a dynamically created array of the same run-time type as the given array if not.

If there is space remaining in the array, the first element after the end of the collection is set to null (this is only useful if the collection is known to contain no null elements, however). This implementation first tests whether the given array is large enough to hold all the elements of the collection. If not, the reflection API is used to allocate a new array of the same run-time type. Next an iterator is obtained over the collection and the elements are placed in the array as they are returned by the iterator. Finally the first spare element, if any, of the array is set to null, and the created array is returned. The returned array is safe; it is not backed by the collection. Note that null may not mark the last element, if the collection allows null elements.

Parameters:
athe array to copy into, or of the correct run-time type
Returns:
the array that was produced
Exceptions:
NullPointerExceptionif the given array is null
ArrayStoreExceptionif the type of the array precludes holding one of the elements of the Collection

Reimplemented from java.util.AbstractList.

Definition at line 662 of file AbstractList.java.

{ return super.toArray(o); }
String java.util.AbstractCollection.toString ( ) [inline, inherited]

Creates a String representation of the Collection.

The string returned is of the form "[a, b, ...]" where a and b etc are the results of calling toString on the elements of the collection. This implementation obtains an Iterator over the Collection and adds each element to a StringBuffer as it is returned by the iterator.

Returns:
a String representation of the Collection

Definition at line 423 of file AbstractCollection.java.

  { return super.toString();
    //Iterator itr = iterator();
    //StringBuffer r = new StringBuffer("[");
    //for (int pos = size(); pos > 0; pos--)
    //  {
    //    r.append(itr.next());
    //    if (pos > 1)
    //      r.append(", ");
    //  }
    //r.append("]");
    //return r.toString();
  }

Member Data Documentation

The original list.

Definition at line 649 of file AbstractList.java.

int java.util.AbstractList.modCount [protected, inherited]

A count of the number of structural modifications that have been made to the list (that is, insertions and removals).

Structural modifications are ones which change the list size or affect how iterations would behave. This field is available for use by Iterator and ListIterator, in order to throw a ConcurrentModificationException in response to the next operation on the iterator. This fail-fast behavior saves the user from many subtle bugs otherwise possible from concurrent modification during iteration.

To make lists fail-fast, increment this field by just 1 in the add(int, Object) and remove(int) methods. Otherwise, this field may be ignored.

Definition at line 88 of file AbstractList.java.

int java.util.SubList.offset [package, inherited]

The index of the first element of the sublist.

Definition at line 651 of file AbstractList.java.

int java.util.SubList.size [package, inherited]

The size of the sublist.

Definition at line 653 of file AbstractList.java.


The documentation for this class was generated from the following file: