info.magnolia.cms.util
Class OrderedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by info.magnolia.cms.util.OrderedProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class OrderedProperties
extends Properties

Subclass of java.util.Properties which keeps the order in which properties were loaded, by delegating to a LinkedHashMap. Warning: only the java.util.Map interface methods have been overloaded, so be weary when using java.util.Properties specific methods. (load, save, getProperty and setProperty are working.) (getProperty had to be explicitly overloaded too) The equals() method respects the Map.equals() contract, since the entrySet() method is delegating to the LinkedHashMap.

Version:
$Id: $
Author:
philipp
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
OrderedProperties()
           
 
Method Summary
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 Object get(Object key)
           
 String getProperty(String key)
           
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 int size()
           
 Collection values()
           
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, elements, equals, hashCode, keys, putAll, rehash, remove, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderedProperties

public OrderedProperties()
Method Detail

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map<Object,Object>
Overrides:
put in class Hashtable<Object,Object>

get

public Object get(Object key)
Specified by:
get in interface Map<Object,Object>
Overrides:
get in class Hashtable<Object,Object>

getProperty

public String getProperty(String key)
Overrides:
getProperty in class Properties

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<Object,Object>
Overrides:
containsValue in class Hashtable<Object,Object>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<Object,Object>
Overrides:
containsKey in class Hashtable<Object,Object>

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map<Object,Object>
Overrides:
entrySet in class Hashtable<Object,Object>

keySet

public Set keySet()
Specified by:
keySet in interface Map<Object,Object>
Overrides:
keySet in class Hashtable<Object,Object>

values

public Collection values()
Specified by:
values in interface Map<Object,Object>
Overrides:
values in class Hashtable<Object,Object>

size

public int size()
Specified by:
size in interface Map<Object,Object>
Overrides:
size in class Hashtable<Object,Object>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<Object,Object>
Overrides:
isEmpty in class Hashtable<Object,Object>


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.