edu.rit.m2mi
Class ExportMap

java.lang.Object
  extended by edu.rit.m2mi.ExportMap
Direct Known Subclasses:
EoidExportMap, InterfaceExportMap

public abstract class ExportMap
extends Object

Class ExportMap is the abstract base class for a mapping that stores exported objects.

Note: Class ExportMap is not multiple thread safe.


Constructor Summary
ExportMap(M2MIMessagePrefix theMessagePrefixBag)
          Construct a new, empty export map.
 
Method Summary
protected  void export(Object key, Object obj)
          Export the given object with the given key in this export map.
protected  boolean isExported(Object key)
          Determine if any object(s) are exported with the given key in this export map.
protected  boolean isExported(Object key, Object obj)
          Determine if the given object is exported with the given key in this export map.
protected  Iterator iterator(Object key)
          Obtain an iterator for visiting the objects exported with the given key in this export map.
 void unexport(Object obj)
          Unexport the given object in this export map.
protected  void unexport(Object key, Object obj)
          Unexport the given object from the given key in this export map.
protected  void unexportKey(Object key)
          Unexport all objects from the given key in this export map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExportMap

public ExportMap(M2MIMessagePrefix theMessagePrefixBag)
Construct a new, empty export map.

Parameters:
theMessagePrefixBag - M2MI message prefix bag.
Throws:
NullPointerException - (unchecked exception) Thrown if theMessagePrefixBag is null.
Method Detail

unexport

public void unexport(Object obj)
Unexport the given object in this export map. The given object is no longer associated with any key in this export map.

Parameters:
obj - Object to unexport.
Throws:
NullPointerException - (unchecked exception) Thrown if obj is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the object.

export

protected void export(Object key,
                      Object obj)
Export the given object with the given key in this export map. If the given object is already exported with the given key, export() has no effect.

Parameters:
key - Key.
obj - Object to export.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem exporting the object.

unexport

protected void unexport(Object key,
                        Object obj)
Unexport the given object from the given key in this export map. If the given object is exported with any other keys, it remains exported with those keys.

Parameters:
key - Key.
obj - Object to unexport.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the object.

unexportKey

protected void unexportKey(Object key)
Unexport all objects from the given key in this export map. If those objects are exported with any other keys, they remain exported with those keys.

Parameters:
key - Key.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the objects.

isExported

protected boolean isExported(Object key)
Determine if any object(s) are exported with the given key in this export map.

Parameters:
key - Key.
Returns:
True if any objects are exported with key, false otherwise.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null.

isExported

protected boolean isExported(Object key,
                             Object obj)
Determine if the given object is exported with the given key in this export map.

Parameters:
key - Key.
obj - Object.
Returns:
True if obj is exported with key, false otherwise.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null or obj is null.

iterator

protected Iterator iterator(Object key)
Obtain an iterator for visiting the objects exported with the given key in this export map. The iterator() method takes a "snapshot" of the exported objects at the time it is called, and returns an iterator for the snapshot. Subsequent changes to this export map will have no effect on the returned iterator.

Parameters:
key - Key.
Returns:
Iterator.
Throws:
NullPointerException - (unchecked exception) Thrown if key is null.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.