net.infonode.docking.util
Class AbstractViewMap

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

public abstract class AbstractViewMap
extends Object
implements ViewFactoryManager, ViewSerializer

Base class for view maps.

Since:
IDW 1.1.0
Version:
$Revision: 1.11 $

Constructor Summary
AbstractViewMap()
           
 
Method Summary
 boolean contains(View view)
          Returns true if this view map contains the view.
 View getViewAtIndex(int index)
          Returns the view at a specific index.
 int getViewCount()
          Returns the number of views in this map.
 ViewFactory[] getViewFactories()
          Returns the view factories.
 View readView(ObjectInputStream in)
          Reads and returns a view.
 void writeView(View view, ObjectOutputStream out)
          Writes a view to a stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractViewMap

public AbstractViewMap()
Method Detail

getViewCount

public int getViewCount()
Returns the number of views in this map.

Returns:
the number of views in this map

getViewAtIndex

public View getViewAtIndex(int index)
Returns the view at a specific index. The view index is the same as the number of views in the map when the view was added to the map.

Parameters:
index - the view index
Returns:
the view at the index

getViewFactories

public ViewFactory[] getViewFactories()
Description copied from interface: ViewFactoryManager
Returns the view factories.

Specified by:
getViewFactories in interface ViewFactoryManager
Returns:
the view factories

contains

public boolean contains(View view)
Returns true if this view map contains the view.

Parameters:
view - the view
Returns:
true if this view map contains the view
Since:
IDW 1.3.0

writeView

public void writeView(View view,
                      ObjectOutputStream out)
               throws IOException
Description copied from interface: ViewSerializer
Writes a view to a stream. Note that the view property values are written automatically, so this method should not write them.

Specified by:
writeView in interface ViewSerializer
Parameters:
view - the view to write
out - the stream on which to write the view
Throws:
IOException - if there is a stream error

readView

public View readView(ObjectInputStream in)
              throws IOException
Description copied from interface: ViewSerializer
Reads and returns a view. Must read all the data written in the ViewSerializer.writeView(net.infonode.docking.View, java.io.ObjectOutputStream) method. Note that the view property values are read automatically, so this method should not read them. This method should return null if the serialized view can't be resolved.

Specified by:
readView in interface ViewSerializer
Parameters:
in - the stream from which to read the view state
Returns:
the view, null if the view can't be resolved
Throws:
IOException - if there is a stream error


Copyright © 2007 NNL Technology AB. All Rights Reserved.