    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

##

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

##

CEImpl(UpdatableCollection)

##

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

##

coll_

     protected UpdatableCollection coll_

  The collection being enumerated

version_

     protected int version_

  The version number of the collection we got upon construction

remaining_

     protected int remaining_

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

##

CEImpl

     protected CEImpl(UpdatableCollection c)

##

corrupted

     public boolean corrupted()

  Implements collections.CollectionEnumeration.corrupted. Claim corruption if version numbers differ

  See Also:
    corrupted

numberOfRemainingElements

     public int numberOfRemainingElements()

  Implements collections.CollectionEnumeration.numberOfRemaingingElements.

  See Also:
    numberOfRemainingElements

hasMoreElements

     public boolean hasMoreElements()

  Implements java.util.Enumeration.hasMoreElements. Return true if numberOfRemainingElements > 0 and not corrupted

  See Also:
    hasMoreElements

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.

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