org.apache.nutch.protocol.httpclient
Class MultiProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.apache.nutch.protocol.httpclient.MultiProperties
All Implemented Interfaces:
Cloneable, Map, Serializable

public class MultiProperties
extends Properties

An extension to Properties which allows multiple values for a single key. The get(Object) method may return a single value or a Collection of values.

Author:
Matt Tencati
See Also:
Serialized Form

Field Summary
static Logger LOG
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
MultiProperties()
          Creates an empty MultiProperties list with no default values.
MultiProperties(Properties defaults)
          Creates an empty MultiProperties list with the specified defaults.
 
Method Summary
 Object get(Object key)
          Returns the value associated with the given key.
 Object put(Object key, Object value)
          Adds the given value using the key
 void putAll(Map t)
          Add all entries of the given map to this MultiProperties list.
 String toString()
          A string representation of this MultiProperties list.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final Logger LOG
Constructor Detail

MultiProperties

public MultiProperties()
Creates an empty MultiProperties list with no default values.


MultiProperties

public MultiProperties(Properties defaults)
Creates an empty MultiProperties list with the specified defaults.

Parameters:
defaults - A Properties object to use as default values
Method Detail

put

public Object put(Object key,
                  Object value)
           throws NullPointerException
Adds the given value using the key

Parameters:
key - The key for the value
value - The value to store in the Property map
Throws:
NullPointerException
See Also:
Dictionary.put(java.lang.Object, java.lang.Object)

putAll

public void putAll(Map t)
            throws NullPointerException
Add all entries of the given map to this MultiProperties list. The entries will be added using the key retrieved from Map.keySet()

Parameters:
t - The Map object which containts the values to add.
Throws:
NullPointerException
See Also:
Map.putAll(java.util.Map)

get

public Object get(Object key)
           throws NullPointerException
Returns the value associated with the given key. The return object may be either a single value (String) or a Collection of values.

Parameters:
key - Used to lookup the value
Returns:
Returns a single value or multiple values if available
Throws:
NullPointerException
See Also:
Dictionary.get(java.lang.Object)

toString

public String toString()
A string representation of this MultiProperties list.

Returns:
A multi-line String object.
See Also:
Object.toString()


Copyright © 2006 The Apache Software Foundation