org.progeeks.meta.util
Class TypedMap

java.lang.Object
  extended by org.progeeks.util.beans.BeanChangeSupport
      extended by org.progeeks.util.ObservableMap
          extended by org.progeeks.meta.util.TypedMap
All Implemented Interfaces:
java.io.Serializable, java.util.Map, StandardBean

public class TypedMap
extends ObservableMap

A Map implementation providing field-level change notification as well as type information compatible with the core meta-jb property info classes..

Version:
$Revision: 1.8 $
Author:
Paul Speed
See Also:
Serialized Form

Constructor Summary
TypedMap()
          Typed map implementation wrapping a HashMap instance.
TypedMap(java.util.Collection infos)
          Typed map implementation using the specified property information.
TypedMap(java.util.Map map)
          Typed map implementation wrapping the specified map.
TypedMap(java.util.Map map, java.util.Collection infos)
          Typed map implementation wrapping the specified map and using the specified property information.
 
Method Summary
 void addProperty(PropertyInfo info)
          Adds the specified property info to this typed map.
 void addProperty(java.lang.String propertyName, java.lang.Class type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 void addProperty(java.lang.String propertyName, MetaClass type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 void addProperty(java.lang.String propertyName, PropertyType type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 PropertyInfo getPropertyInfo(java.lang.String name)
          Returns the descriptive information for the specified property.
 java.util.Collection getPropertyInfos()
          Returns an unmodifiable collection of property info objects.
static java.util.List getPropertyInfos(java.util.Map map)
          Returns a list of property info objects by inspecting the contents of the map and using simple heuristics to determine value types.
 java.util.Set getPropertyNames()
          Returns the unmodifiable set of property names.
 PropertyType getPropertyType(java.lang.String name)
          Returns the type for the specified property.
 java.util.Iterator propertyNames()
          Returns an iterator over all valid property names.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          A type-safe version of put().
 
Methods inherited from class org.progeeks.util.ObservableMap
clear, containsKey, containsValue, entrySet, equals, fireMapPropertyChange, get, getMap, hashCode, isEmpty, keySet, putAll, remove, setMap, size, toString, values
 
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypedMap

public TypedMap()
Typed map implementation wrapping a HashMap instance.


TypedMap

public TypedMap(java.util.Map map)
Typed map implementation wrapping the specified map.


TypedMap

public TypedMap(java.util.Map map,
                java.util.Collection infos)
Typed map implementation wrapping the specified map and using the specified property information.


TypedMap

public TypedMap(java.util.Collection infos)
Typed map implementation using the specified property information.

Method Detail

getPropertyInfos

public static java.util.List getPropertyInfos(java.util.Map map)
Returns a list of property info objects by inspecting the contents of the map and using simple heuristics to determine value types.


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
A type-safe version of put().

Specified by:
put in interface java.util.Map
Overrides:
put in class ObservableMap

addProperty

public void addProperty(java.lang.String propertyName,
                        PropertyType type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(java.lang.String propertyName,
                        MetaClass type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.Class type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(PropertyInfo info)
Adds the specified property info to this typed map.


getPropertyType

public PropertyType getPropertyType(java.lang.String name)
Returns the type for the specified property.


getPropertyInfo

public PropertyInfo getPropertyInfo(java.lang.String name)
Returns the descriptive information for the specified property.


propertyNames

public java.util.Iterator propertyNames()
Returns an iterator over all valid property names.


getPropertyNames

public java.util.Set getPropertyNames()
Returns the unmodifiable set of property names.


getPropertyInfos

public java.util.Collection getPropertyInfos()
Returns an unmodifiable collection of property info objects.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.