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 voidbooleanReturns true if this view map contains the view.protected ViewgetViewAtIndex(int index) Returns the view at a specific index.intReturns the number of views in this map.Returns the view factories.Reads and returns a view.protected abstract Objectprotected voidremoveView(Object id) voidwriteView(View view, ObjectOutputStream out) Writes a view to a stream.protected abstract voidwriteViewId(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:ViewFactoryManagerReturns the view factories.- Specified by:
getViewFactoriesin 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:ViewSerializerWrites a view to a stream. Note that the view property values are written automatically, so this method should not write them.- Specified by:
writeViewin 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:ViewSerializerReads 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:
readViewin 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
-