com.togethersoft.openapi.util.propertyMap
Class SwitchablePropertyMap


public class SwitchablePropertyMap
implements PropertyMap

Represents PropertyMap with ability to switch to another PropertyMap.

Author:
TogetherSoft
Since: Together 4.0

Inner Class Summary
 private classSwitchablePropertyMap.MyProperty
           

Field Summary
 private EventMulticastermyAllKeysMulticaster
           
 private PropertyMapListenermyListener
           
 private PropertyMapmyMap
           
 private HashtablemyMulticasterMap
           

Constructor Summary
SwitchablePropertyMap(PropertyMap map)
          Creates new SwitchablePropertyMap from existing.
SwitchablePropertyMap()
          Creates new empty SwitchablePropertyMap.

Method Summary
 PropertyaddProperty(Object propertyKey, Object propertyValue)
          Adds specified property with it's value.
 voidaddPropertyMapListener(Object propertyKey, PropertyMapListener listener)
          Adds listener of PropertyMapEvent for specified property.
 booleancanAddProperty(Object propertyKey, Object propertyValue)
          Checks whether it is possible to add specified property with specified value.
 booleancanSetPropertyValue(Object propertyKey, Object propertyValue)
          Checks whether it is possible to set specified value to specified property.
 protected voidfireEvent(PropertyMapEvent event)
          Fires specified PropertyMapEvent.
 PropertyMapgetPropertyMap()
          Returns current PropertyMap.
 ObjectgetPropertyValue(Object propertyKey)
          Returns value of specified property.
 ObjectgetPropertyValue(Object propertyKey, Class valueClass)
          Returns value of specified property and with specified class of value.
 booleanisPropertyReadable(Object propertyKey)
          Checks whether specified property can be read.
 booleanisPropertyWritable(Object propertyKey)
          Checks whether it is possible to write to specified property.
 Enumerationproperties()
          Returns Enumeration of all properties.
 Enumerationproperties(Object propertyKey)
          Returns values of specified property.
 voidremovePropertyMapListener(Object propertyKey, PropertyMapListener listener)
          Removes listener of PropertyMapEvent for specified property.
 voidsetPropertyMap(PropertyMap map)
          Specifies new PropertyMap.
 voidsetPropertyValue(Object propertyKey, Object propertyValue)
          Sets specified valuy to specified property.

Field Detail

myAllKeysMulticaster

private EventMulticaster myAllKeysMulticaster

myListener

private PropertyMapListener myListener

myMap

private PropertyMap myMap

myMulticasterMap

private Hashtable myMulticasterMap
Constructor Detail

SwitchablePropertyMap

public SwitchablePropertyMap(PropertyMap map)
Creates new SwitchablePropertyMap from existing.
Parameters:
map Source map

SwitchablePropertyMap

public SwitchablePropertyMap()
Creates new empty SwitchablePropertyMap.
Method Detail

addProperty

public Property addProperty(Object propertyKey, Object propertyValue)
Adds specified property with it's value.
Parameters:
propertyKey Key of property to be added
propertyValue Value of new property
Returns: Added Property

addPropertyMapListener

public void addPropertyMapListener(Object propertyKey, PropertyMapListener listener)
Adds listener of PropertyMapEvent for specified property.
Parameters:
propertyKey Key of property to which listener will be added
listener PropertyMapListener to be added

canAddProperty

public boolean canAddProperty(Object propertyKey, Object propertyValue)
Checks whether it is possible to add specified property with specified value.
Parameters:
propertyKey Key of property to be checked
propertyValue Value to be checked
Returns: true if so, false otherwise

canSetPropertyValue

public boolean canSetPropertyValue(Object propertyKey, Object propertyValue)
Checks whether it is possible to set specified value to specified property.
Parameters:
propertyKey Key of property to be checked
propertyValue Value to be checked

fireEvent

protected void fireEvent(PropertyMapEvent event)
Fires specified PropertyMapEvent.
Parameters:
event PropertyMapEvent to be fired

getPropertyMap

public PropertyMap getPropertyMap()
Returns current PropertyMap.
Returns: current PropertyMap

getPropertyValue

public Object getPropertyValue(Object propertyKey)
Returns value of specified property.
Parameters:
propertyKey Key of property for which value will be returned
Returns: Value of specified property

getPropertyValue

public Object getPropertyValue(Object propertyKey, Class valueClass)
throws CastNotSupportedException
Returns value of specified property and with specified class of value.
Parameters:
propertyKey Key of property for which value will be returned
Returns: Value of specified property

isPropertyReadable

public boolean isPropertyReadable(Object propertyKey)
Checks whether specified property can be read.
Parameters:
propertyKey Key of property to be checked
Returns: true if so, false otherwise

isPropertyWritable

public boolean isPropertyWritable(Object propertyKey)
Checks whether it is possible to write to specified property.
Parameters:
propertyKey Key of property to be checked
Returns: true if so, false otherwise

properties

public Enumeration properties()
Returns Enumeration of all properties.
Returns: Enumeration of all properties or EmptyEnumeration if there are no ones
See Also:
EmptyEnumeration

properties

public Enumeration properties(Object propertyKey)
Returns values of specified property.
Parameters:
propertyKey Key of property
Returns: Values of specified property, or EmptyEnumeration if there are no ones
See Also:
EmptyEnumeration

removePropertyMapListener

public void removePropertyMapListener(Object propertyKey, PropertyMapListener listener)
Removes listener of PropertyMapEvent for specified property.
Parameters:
propertyKey Key of property to which listener will be removeded
listener PropertyMapListener to be removed

setPropertyMap

public void setPropertyMap(PropertyMap map)
Specifies new PropertyMap.
Parameters:
map New property map

setPropertyValue

public void setPropertyValue(Object propertyKey, Object propertyValue)
Sets specified valuy to specified property.
Parameters:
propertyKey Key of property fo which new value will be set
/ @param propertyValue New property value

Association Links

to Class com.togethersoft.openapi.util.propertyMap.PropertyMap

to Class com.togethersoft.openapi.util.propertyMap.PropertyMapListener

to Class java.util.Hashtable

to Class com.togethersoft.openapi.util.EventMulticaster