com.cometway.props
Class ReadOnlyPropsContainer

java.lang.Object
  extended by com.cometway.props.ReadOnlyPropsContainer
All Implemented Interfaces:
IPropsContainer

public class ReadOnlyPropsContainer
extends java.lang.Object
implements IPropsContainer

Use this class to allow read only access to a IPropsContainer.


Constructor Summary
ReadOnlyPropsContainer(IPropsContainer container)
           
 
Method Summary
 void copy(IPropsContainer ipc)
          copy the properties in the current container to another container
 java.util.Enumeration enumerateProps()
          list the properties in the current container
 java.lang.Object getProperty(java.lang.String key)
          Returns a reference to a named object.
 boolean removeProperty(java.lang.String key)
          Throws a RuntimeException when called: This operation is illegal.
 void setProperty(java.lang.String key, java.lang.Object value)
          Throws a RuntimeException when called: This operation is illegal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyPropsContainer

public ReadOnlyPropsContainer(IPropsContainer container)
Method Detail

copy

public void copy(IPropsContainer ipc)
Description copied from interface: IPropsContainer
copy the properties in the current container to another container

Specified by:
copy in interface IPropsContainer
Parameters:
ipc - the container to be copied into.

enumerateProps

public java.util.Enumeration enumerateProps()
Description copied from interface: IPropsContainer
list the properties in the current container

Specified by:
enumerateProps in interface IPropsContainer
Returns:
an Enumeration of keys

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: IPropsContainer
Returns a reference to a named object.

Specified by:
getProperty in interface IPropsContainer
Parameters:
key - the name of the object to retrieve.
Returns:
an object reference.

removeProperty

public boolean removeProperty(java.lang.String key)
Throws a RuntimeException when called: This operation is illegal.

Specified by:
removeProperty in interface IPropsContainer
Parameters:
key - the name of the object to remove.
Returns:
true if the object existed and was removed; false otherwise.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Throws a RuntimeException when called: This operation is illegal.

Specified by:
setProperty in interface IPropsContainer
Parameters:
key - the name of the object to add or change.
value - a reference to the new object.