home *** CD-ROM | disk | FTP | other *** search
- package com.bitmechanic.util;
-
- import java.util.Enumeration;
- import java.util.Stack;
-
- public class EnumerationStack implements Enumeration {
- private Stack stack = new Stack();
- // $FF: renamed from: enum java.util.Enumeration
- private Enumeration field_0;
-
- public EnumerationStack() {
- }
-
- public EnumerationStack(Enumeration var1) {
- this.field_0 = var1;
- }
-
- public void push(Enumeration var1) {
- if (this.field_0 == null) {
- this.field_0 = var1;
- } else {
- this.stack.push(var1);
- }
- }
-
- public boolean hasMoreElements() {
- if (this.field_0 != null && this.field_0.hasMoreElements()) {
- return true;
- } else if (!this.stack.empty()) {
- this.field_0 = (Enumeration)this.stack.pop();
- return this.hasMoreElements();
- } else {
- return false;
- }
- }
-
- public Object nextElement() {
- if (this.field_0 != null && this.field_0.hasMoreElements()) {
- return this.field_0.nextElement();
- } else if (!this.stack.empty()) {
- this.field_0 = (Enumeration)this.stack.pop();
- return this.nextElement();
- } else {
- return null;
- }
- }
- }
-