EmptyEnumeration.java Source code

Java tutorial

Introduction

Here is the source code for EmptyEnumeration.java

Source

/*
 * Copyright Javelin Software, All rights reserved.
 */

import java.util.*;

/**
 * An EmptyEnumeration.
 *
 * @author Robin Sharp
 */

public class EmptyEnumeration implements Enumeration {
    public static Enumeration getInstance() {
        return enumeration;
    }

    /**
     * @return false;
     */
    public boolean hasMoreElements() {
        return false;
    }

    /**
     * @return null
     */
    public Object nextElement() {
        return null;
    }

    protected static Enumeration enumeration = new EmptyEnumeration();
}