org.jboss.portal.common.util
Class SimpleMultiValuedPropertyMap<T>

java.lang.Object
  extended by org.jboss.portal.common.util.SimpleMultiValuedPropertyMap<T>
All Implemented Interfaces:
MultiValuedPropertyMap<T>

public class SimpleMultiValuedPropertyMap<T>
extends java.lang.Object
implements MultiValuedPropertyMap<T>

A map of multi valued properties.

Version:
$Revision: 630 $
Author:
Julien Viet

Constructor Summary
SimpleMultiValuedPropertyMap()
           
 
Method Summary
 void addValue(java.lang.String key, T value)
           
 void append(MultiValuedPropertyMap<T> appended)
          Append the multi valued property map to this one.
 void clear()
          Clear the properties.
 T getValue(java.lang.String key)
          Returns the first property value or null if it cannot be found.
 java.util.List<T> getValues(java.lang.String key)
          Returns the list of values for a specified property.
 java.util.Set<java.lang.String> keySet()
          Returns the set of property keys.
 void setValue(java.lang.String key, T value)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMultiValuedPropertyMap

public SimpleMultiValuedPropertyMap()
Method Detail

addValue

public void addValue(java.lang.String key,
                     T value)
Specified by:
addValue in interface MultiValuedPropertyMap<T>
Parameters:
key - the property key
value - the property value
Throws:
java.lang.IllegalArgumentException - if name or value is null

setValue

public void setValue(java.lang.String key,
                     T value)
Specified by:
setValue in interface MultiValuedPropertyMap<T>
Parameters:
key - the property key
value - the property value
Throws:
java.lang.IllegalArgumentException - if name or value is null

clear

public void clear()
Clear the properties.

Specified by:
clear in interface MultiValuedPropertyMap<T>

getValue

public T getValue(java.lang.String key)
           throws java.lang.IllegalArgumentException
Returns the first property value or null if it cannot be found.

Specified by:
getValue in interface MultiValuedPropertyMap<T>
Parameters:
key - the property key
Returns:
the property value
Throws:
java.lang.IllegalArgumentException - if the name argument is null

getValues

public java.util.List<T> getValues(java.lang.String key)
Returns the list of values for a specified property.

Specified by:
getValues in interface MultiValuedPropertyMap<T>
Parameters:
key - the property key
Returns:
the list of properties for the specified name or null if it does not exist
Throws:
java.lang.IllegalArgumentException - if name argument is null

keySet

public java.util.Set<java.lang.String> keySet()
Returns the set of property keys.

Specified by:
keySet in interface MultiValuedPropertyMap<T>
Returns:
the set of property keys

size

public int size()
Specified by:
size in interface MultiValuedPropertyMap<T>

append

public void append(MultiValuedPropertyMap<T> appended)
            throws java.lang.IllegalArgumentException
Append the multi valued property map to this one. Entries from the provided map that do not exist in the current map are created, entries that exist in both maps are concatenated in the existing map with the values of the existing map being before the values of the provided map.

Specified by:
append in interface MultiValuedPropertyMap<T>
Parameters:
appended - the property map to append
Throws:
java.lang.IllegalArgumentException - if the provided map is null


Copyright © 2008. All Rights Reserved.