All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class collections.CEImpl

java.lang.Object
   |
   +----collections.CEImpl

public class CEImpl
extends Object
implements CollectionEnumeration
A convenient base class for implementations of CollectionEnumeration


Variable Index

 o coll_
The collection being enumerated
 o remaining_
The number of elements we think we have left.
 o version_
The version number of the collection we got upon construction

Constructor Index

 o CEImpl(UpdatableCollection)

Method Index

 o corrupted()
Implements collections.CollectionEnumeration.corrupted.
 o decRemaining()
Subclass utility.
 o hasMoreElements()
Implements java.util.Enumeration.hasMoreElements.
 o nextElement()
Implements java.util.Enumeration.nextElement.
 o numberOfRemainingElements()
Implements collections.CollectionEnumeration.numberOfRemaingingElements.

Variables

 o coll_
 protected UpdatableCollection coll_
The collection being enumerated

 o version_
 protected int version_
The version number of the collection we got upon construction

 o remaining_
 protected int remaining_
The number of elements we think we have left. Initialized to coll_.size() upon construction

Constructors

 o CEImpl
 protected CEImpl(UpdatableCollection c)

Methods

 o corrupted
 public boolean corrupted()
Implements collections.CollectionEnumeration.corrupted. Claim corruption if version numbers differ

See Also:
corrupted
 o numberOfRemainingElements
 public int numberOfRemainingElements()
Implements collections.CollectionEnumeration.numberOfRemaingingElements.

See Also:
numberOfRemainingElements
 o hasMoreElements
 public boolean hasMoreElements()
Implements java.util.Enumeration.hasMoreElements. Return true if numberOfRemainingElements > 0 and not corrupted

See Also:
hasMoreElements
 o decRemaining
 protected void decRemaining() throws NoSuchElementException
Subclass utility. Tries to decrement remaining_, raising exceptions if it is already zero or if corrupted() Always call as the first line of nextElement.

 o nextElement
 public Object nextElement()
Implements java.util.Enumeration.nextElement. No-Op default version

See Also:
nextElement

All Packages  Class Hierarchy  This Package  Previous  Next  Index