Returns an enumeration of the hashtable keys that is not changed by parallel changes to the hashtable. - Java java.util

Java examples for java.util:Hashtable Operation

Description

Returns an enumeration of the hashtable keys that is not changed by parallel changes to the hashtable.

Demo Code


//package com.java2s;

import java.util.Enumeration;

import java.util.Hashtable;

public class Main {
    /**/*from ww w.  j  av a 2  s. co m*/
     * Returns an enumeration of the hashtable keys that is not changed by parallel changes to the hashtable.
     * 
     * @param hashtable
     * @return
     */
    public static Enumeration getPersistentKeysEnumeration(
            Hashtable hashtable) {
        return ((Hashtable) hashtable.clone()).keys();
    }
}

Related Tutorials