diva.util
Class BasicPropertyContainer

java.lang.Object
  extended by diva.util.BasicPropertyContainer
All Implemented Interfaces:
PropertyContainer
Direct Known Subclasses:
BasicGraphModel.Intermediate

public class BasicPropertyContainer
extends java.lang.Object
implements PropertyContainer

An object that can be annotated with arbitrary objects whose keys are strings.

Version:
$Id: BasicPropertyContainer.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman

Field Summary
(package private)  PropertyContainer _defaults
          The default values, if applicable.
(package private)  java.util.HashMap _mapping
          The mapping from keys to values.
 
Constructor Summary
BasicPropertyContainer()
          A property container with no defaults.
BasicPropertyContainer(PropertyContainer defaults)
          A property container with no defaults.
 
Method Summary
 java.lang.Object getProperty(java.lang.String key)
          Return the property corresponding to the given key, or null if no such property exists.
 java.util.Iterator properties()
           
 java.util.Iterator propertyNames()
          Return an iteration of the names of the properties
 void removeAllProperties()
           
 void setProperty(java.lang.String key, java.lang.Object value)
          Set the property corresponding to the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_defaults

PropertyContainer _defaults
The default values, if applicable.


_mapping

java.util.HashMap _mapping
The mapping from keys to values.

Constructor Detail

BasicPropertyContainer

public BasicPropertyContainer()
A property container with no defaults.


BasicPropertyContainer

public BasicPropertyContainer(PropertyContainer defaults)
A property container with no defaults.

Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Return the property corresponding to the given key, or null if no such property exists.

Specified by:
getProperty in interface PropertyContainer

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Set the property corresponding to the given key.

Specified by:
setProperty in interface PropertyContainer

removeAllProperties

public void removeAllProperties()

properties

public java.util.Iterator properties()

propertyNames

public java.util.Iterator propertyNames()
Return an iteration of the names of the properties

Specified by:
propertyNames in interface PropertyContainer