Package net.infonode.docking.util
Class AbstractViewMap
java.lang.Object
net.infonode.docking.util.AbstractViewMap
- All Implemented Interfaces:
ViewFactoryManager
,ViewSerializer
- Direct Known Subclasses:
StringViewMap
,ViewMap
Base class for view maps.
- Since:
- IDW 1.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
Returns true if this view map contains the view.protected View
getViewAtIndex
(int index) Returns the view at a specific index.int
Returns the number of views in this map.Returns the view factories.Reads and returns a view.protected abstract Object
protected void
removeView
(Object id) void
writeView
(View view, ObjectOutputStream out) Writes a view to a stream.protected abstract void
writeViewId
(Object id, ObjectOutputStream out)
-
Constructor Details
-
AbstractViewMap
public AbstractViewMap()
-
-
Method Details
-
writeViewId
- Throws:
IOException
-
readViewId
- Throws:
IOException
-
getViewCount
public int getViewCount()Returns the number of views in this map.- Returns:
- the number of views in this map
-
getViewAtIndex
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
Description copied from interface:ViewFactoryManager
Returns the view factories.- Specified by:
getViewFactories
in interfaceViewFactoryManager
- Returns:
- the view factories
-
contains
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
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 interfaceViewSerializer
- Parameters:
view
- the view to writeout
- the stream on which to write the view- Throws:
IOException
- if there is a stream error
-
readView
Description copied from interface:ViewSerializer
Reads and returns a view. Must read all the data written in theViewSerializer.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 interfaceViewSerializer
- 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
-
addView
-
removeView
-
getView
-