API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. Properties View Source
Author(s)
Arthur van Hoff
Michael McCloskey
Xueming Shen
Since
JDK1.0
Version
1.96, 08/07/06
Serial
Hierarchy
 Object
      Dictionary
          Hashtable
              Properties
Implements
Subclasses
Description
public class Properties
  The Properties class represents a persistent set of properties.
See also:    native2ascii tool for Solaris native2ascii tool for Windows

This class is thread-safe: multiple threads can share a single Properties object without the need for external synchronization.

Constructors
public Properties ()
Creates an empty property list with no default values.
public Properties (Properties defaults)
  Creates an empty property list with the specified defaults.
Methods
Hide/Show inherited methods
publicsynchronized void clear () [Inherited From Hashtable]
Clears this hashtable so that it contains no keys.
publicsynchronized Object clone () [Inherited From Hashtable]
  Creates a shallow copy of this hashtable.
publicsynchronized boolean contains (Object value) [Inherited From Hashtable]
  Tests if some key maps into the specified value in this hashtable.
publicsynchronized boolean containsKey (Object key) [Inherited From Hashtable]
  Tests if the specified object is a key in this hashtable.
public boolean containsValue (Object value) [Inherited From Hashtable]
  Returns true if this hashtable maps one or more keys to this value.
publicsynchronized Enumeration< V> elements () [Inherited From Hashtable] [Specified in Dictionary]
  Returns an enumeration of the values in this hashtable.
public Set<Entry< K, V>> entrySet () [Inherited From Hashtable]
  Returns a Set view of the mappings contained in this map.
publicsynchronized boolean equals (Object o) [Inherited From Hashtable]
  Compares the specified Object with this Map for equality, as per the definition in the Map interface.
publicsynchronized V get (Object key) [Inherited From Hashtable] [Specified in Dictionary]
  Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public String getProperty (String key)
  Searches for the property with the specified key in this property list.
public String getProperty (String key, String defaultValue)
  Searches for the property with the specified key in this property list.
publicsynchronized int hashCode () [Inherited From Hashtable]
  Returns the hash code value for this Map as per the definition in the Map interface.
publicsynchronized boolean isEmpty () [Inherited From Hashtable] [Specified in Dictionary]
  Tests if this hashtable maps no keys to values.
publicsynchronized Enumeration< K> keys () [Inherited From Hashtable] [Specified in Dictionary]
  Returns an enumeration of the keys in this hashtable.
public Set< K> keySet () [Inherited From Hashtable]
  Returns a Set view of the keys contained in this map.
public void list (PrintStream out)
  Prints this property list out to the specified output stream.
public void list (PrintWriter out)
  Prints this property list out to the specified output stream.
publicsynchronized void load (InputStream inStream) throws IOException
  Reads a property list (key and element pairs) from the input byte stream.
publicsynchronized void load (Reader reader) throws IOException
  Reads a property list (key and element pairs) from the input character stream in a simple line-oriented format.
publicsynchronized void loadFromXML (InputStream in) throws IOException InvalidPropertiesFormatException
  Loads all of the properties represented by the XML document on the specified input stream into this properties table.
public Enumeration<Object> propertyNames ()
  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.
publicsynchronized V put ( K key, V value) [Inherited From Hashtable] [Specified in Dictionary]
  Maps the specified key to the specified value in this hashtable.
publicsynchronized void putAll (Map<Object, Object> t) [Inherited From Hashtable]
  Copies all of the mappings from the specified map to this hashtable.
protected void rehash () [Inherited From Hashtable]
  Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.
publicsynchronized V remove (Object key) [Inherited From Hashtable] [Specified in Dictionary]
  Removes the key (and its corresponding value) from this hashtable.
@Deprecated
publicsynchronized void save (OutputStream out, String comments)
  Calls the store(OutputStream out, String comments) method and suppresses IOExceptions that were thrown.
publicsynchronized Object setProperty (String key, String value)
  Calls the Hashtable method put.
publicsynchronized int size () [Inherited From Hashtable] [Specified in Dictionary]
  Returns the number of keys in this hashtable.
public void store (OutputStream out, String comments) throws IOException
  Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load(InputStream) method.
public void store (Writer writer, String comments) throws IOException
  Writes this property list (key and element pairs) in this Properties table to the output character stream in a format suitable for using the load(Reader) method.
publicsynchronized void storeToXML (OutputStream os, String comment) throws IOException
  Emits an XML document representing all of the properties contained in this table.
publicsynchronized void storeToXML (OutputStream os, String comment, String encoding) throws IOException
  Emits an XML document representing all of the properties contained in this table, using the specified encoding.
public Set<String> stringPropertyNames ()
  Returns a set of keys in this property list where the key and its corresponding value are strings, 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.
publicsynchronized String toString () [Inherited From Hashtable]
  Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "" (comma and space).
public Collection< V> values () [Inherited From Hashtable]
  Returns a Collection view of the values contained in this map.
Fields
Hide/Show inherited fields
protected Properties defaults
A property list that contains default values for any keys not found in this property list.
Nested Classes
  Properties.LineReader
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar