net.infonode.docking.util
Class ViewMap

java.lang.Object
  extended bynet.infonode.docking.util.AbstractViewMap
      extended bynet.infonode.docking.util.ViewMap
All Implemented Interfaces:
ViewFactoryManager, ViewSerializer

public class ViewMap
extends AbstractViewMap

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

Version:
$Revision: 1.7 $

Constructor Summary
ViewMap()
          Constructor.
ViewMap(View[] views)
          Utility constructor that creates a map with a number of views.
 
Method Summary
 void addView(int id, View view)
          Adds a view to the map.
 View getView(int id)
          Returns the view with a specific id.
 void removeView(int id)
          Removes a view with a specific id from the map.
 
Methods inherited from class net.infonode.docking.util.AbstractViewMap
contains, getViewAtIndex, getViewCount, getViewFactories, readView, writeView
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewMap

public ViewMap()
Constructor.


ViewMap

public ViewMap(View[] views)
Utility constructor that creates a map with a number of views. A view gets it's index in the array as id.

Parameters:
views - the views to add to the map
Method Detail

addView

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

Parameters:
id - the view id
view - the view

removeView

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

Parameters:
id - the view id

getView

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

Parameters:
id - the view id
Returns:
the view with the id


Copyright © 2007 NNL Technology AB. All Rights Reserved.