Code example for Enumeration

Methods: hasMoreElements

0
		myEnumeration = _enumeration;
		myPeekStack = new Stack();
	} 
	 
	public boolean hasMoreElements() { 
		return (myPeekStack.size() > 0 || myEnumeration.hasMoreElements());
	} 
	 
	public Object nextElement() {
		Object element;
		if (myPeekStack.size() > 0) {
			element = myPeekStack.pop();
		} 
		else { 
			element = myEnumeration.nextElement();
		} 
		return element;
	} 
	 
	public Object peek() {
Contextual code suggestions in your IDE  Get Codota for Java