antlr.collections.impl

Class LLEnumeration

Implemented Interfaces:
Enumeration

(package private) final class LLEnumeration
extends Object
implements Enumeration

An enumeration of a LList. Maintains a cursor through the list. bad things would happen if the list changed via another thread while we were walking this list.

Field Summary

(package private) LLCell
cursor
(package private) LList
list

Constructor Summary

LLEnumeration(LList l)
Create an enumeration attached to a LList

Method Summary

boolean
hasMoreElements()
Return true/false depending on whether there are more elements to enumerate.
Object
nextElement()
Get the next element in the enumeration.

Field Details

cursor

(package private)  LLCell cursor

list

(package private)  LList list

Constructor Details

LLEnumeration

public LLEnumeration(LList l)
Create an enumeration attached to a LList

Method Details

hasMoreElements

public boolean hasMoreElements()
Return true/false depending on whether there are more elements to enumerate.

nextElement

public Object nextElement()
Get the next element in the enumeration. Destructive in that the returned element is removed from the enumeration. This does not affect the list itself.
Returns:
the next object in the enumeration.