net.infonode.docking.util

Class StringViewMap

public class StringViewMap extends AbstractViewMap

A map of views that handles view serialization by assigning a string id to each view. The id is unique for each view in the map. To guarantee serialization compatibility a view id must remain constant.

Since: IDW 1.1.0

Version: $Revision: 1.7 $

Author: $Author: jesper $

Constructor Summary
StringViewMap()
Constructor.
StringViewMap(View[] views)
Utility constructor that creates a map with a number of views.
Method Summary
voidaddView(View view)
Adds a view to the map.
voidaddView(String id, View view)
Adds a view to the map.
ViewgetView(String id)
Returns the view with a specific id.
protected ObjectreadViewId(ObjectInputStream in)
voidremoveView(String id)
Removes a view with a specific id from the map.
protected voidwriteViewId(Object id, ObjectOutputStream out)

Constructor Detail

StringViewMap

public StringViewMap()
Constructor.

StringViewMap

public StringViewMap(View[] views)
Utility constructor that creates a map with a number of views. A view gets it's title as id.

Parameters: views the views to add to the map

Method Detail

addView

public void addView(View view)
Adds a view to the map. The view title is used as id.

Parameters: view the view

addView

public void addView(String id, View view)
Adds a view to the map.

Parameters: id the view id view the view

getView

public View getView(String id)
Returns the view with a specific id.

Parameters: id the view id

Returns: the view with the id

readViewId

protected Object readViewId(ObjectInputStream in)

removeView

public void removeView(String id)
Removes a view with a specific id from the map.

Parameters: id the view id

writeViewId

protected void writeViewId(Object id, ObjectOutputStream out)