Clone Hashtable, Returns an enumeration of the hashtable elements that is not changed by parallel changes to the hashtable. - Java java.util

Java examples for java.util:Hashtable Operation

Description

Clone Hashtable, Returns an enumeration of the hashtable elements 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 {
    /**/*  ww  w .j a  va  2 s  . co  m*/
     * Returns an enumeration of the hashtable elements that is not changed by parallel changes to the hashtable.
     * 
     * @param hashtable
     * @return
     */
    public static Enumeration getPersistentElementsEnumeration(
            Hashtable hashtable) {
        return ((Hashtable) hashtable.clone()).elements();
    }
}

Related Tutorials