/** * Enumerates all key/value pairs in the specified hashtable. * @param h the hashtable * @throws ClassCastException if any of the property keys * is not of String type. */ private synchronized void enumerate(Hashtable h) { if (defaults != null) { defaults.enumerate(h); } for (Enumeration e = keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); h.put(key, get(key)); } }
/** * Returns an enumeration of all the keys in this property list, * including distinct keys in the default property list if a key * of the same name has not already been found from the main * properties list. * * @return an enumeration of all the keys in this property list, including * the keys in the default property list. * @throws ClassCastException if any key in this property list * is not a string. * @see java.util.Enumeration * @see java.util.Properties#defaults * @see #stringPropertyNames */ public Enumeration<?> propertyNames() { Hashtable h = new Hashtable(); enumerate(h); return h.keys(); }
/** * Returns an enumeration of all the keys in this property list, * including distinct keys in the default property list if a key * of the same name has not already been found from the main * properties list. * * @return an enumeration of all the keys in this property list, including * the keys in the default property list. * @throws ClassCastException if any key in this property list * is not a string. * @see java.util.Enumeration * @see java.util.Properties#defaults * @see #stringPropertyNames */ public Enumeration<?> propertyNames() { Hashtable h= new Hashtable(); enumerate(h); return h.keys(); }
/** * Returns an enumeration of all the keys in this property list, * including distinct keys in the default property list if a key * of the same name has not already been found from the main * properties list. * * @return an enumeration of all the keys in this property list, including * the keys in the default property list. * @throws ClassCastException if any key in this property list * is not a string. * @see java.util.Enumeration * @see java.util.Properties#defaults * @see #stringPropertyNames */ public Enumeration<?> propertyNames() { Hashtable h = new Hashtable(); enumerate(h); return h.keys(); }
/** * Enumerates all key/value pairs in the specified hashtable. * @param h the hashtable * @throws ClassCastException if any of the property keys * is not of String type. */ private synchronized void enumerate(Hashtable h) { if (defaults != null) { defaults.enumerate(h); } for (Enumeration e = keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); h.put(key, get(key)); } }
/** * Enumerates all key/value pairs in the specified hashtable. * @param h the hashtable * @throws ClassCastException if any of the property keys * is not of String type. */ private synchronized void enumerate(Hashtable h) { if (defaults != null) { defaults.enumerate(h); } for (Enumeration e= keys(); e.hasMoreElements();) { String key= (String) e.nextElement(); h.put(key, get(key)); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. */ public void list(PrintStream out) { out.println("-- listing properties --"); Hashtable h = new Hashtable(); enumerate(h); for (Enumeration e = h.keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); String val = (String)h.get(key); if (val.length() > 40) { val = val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. */ public void list(PrintStream out) { out.println("-- listing properties --"); Hashtable h = new Hashtable(); enumerate(h); for (Enumeration e = h.keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); String val = (String)h.get(key); if (val.length() > 40) { val = val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. */ public void list(PrintStream out) { out.println("-- listing properties --"); Hashtable h= new Hashtable(); enumerate(h); for (Enumeration e= h.keys(); e.hasMoreElements();) { String key= (String) e.nextElement(); String val= (String) h.get(key); if (val.length() > 40) { val= val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. * @since JDK1.1 */ /* * Rather than use an anonymous inner class to share common code, this * method is duplicated in order to ensure that a non-1.1 compiler can * compile this file. */ public void list(PrintWriter out) { out.println("-- listing properties --"); Hashtable h = new Hashtable(); enumerate(h); for (Enumeration e = h.keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); String val = (String)h.get(key); if (val.length() > 40) { val = val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. * @since JDK1.1 */ /* * Rather than use an anonymous inner class to share common code, this * method is duplicated in order to ensure that a non-1.1 compiler can * compile this file. */ public void list(PrintWriter out) { out.println("-- listing properties --"); Hashtable h= new Hashtable(); enumerate(h); for (Enumeration e= h.keys(); e.hasMoreElements();) { String key= (String) e.nextElement(); String val= (String) h.get(key); if (val.length() > 40) { val= val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }
/** * Prints this property list out to the specified output stream. * This method is useful for debugging. * * @param out an output stream. * @throws ClassCastException if any key in this property list * is not a string. * @since JDK1.1 */ /* * Rather than use an anonymous inner class to share common code, this * method is duplicated in order to ensure that a non-1.1 compiler can * compile this file. */ public void list(PrintWriter out) { out.println("-- listing properties --"); Hashtable h = new Hashtable(); enumerate(h); for (Enumeration e = h.keys() ; e.hasMoreElements() ;) { String key = (String)e.nextElement(); String val = (String)h.get(key); if (val.length() > 40) { val = val.substring(0, 37) + "..."; } out.println(key + "=" + val); } }