com.levigo.jadice.document
Class AbstractPage

java.lang.Object
  extended by com.levigo.jadice.document.AbstractPage
All Implemented Interfaces:
Page, PropertiesProvider
Direct Known Subclasses:
BasicPage

public abstract class AbstractPage
extends Object
implements Page

An abstract implementation of a Page that ties the handling of user properties and PageListener handling.

Concrete implementations only have to implement the AbstractPageSegment handling and call the method #firePageSegmentModified(PageSegmentEvent) accordingly.

Since:
jadice documentplatform 5.0
See Also:
Page, BasicPage

Field Summary
protected  com.levigo.jadice.document.PageListenerSupport listenerSupport
           
 
Fields inherited from interface com.levigo.jadice.document.Page
PROPERTY_PREFIX_USER_PROPERTY
 
Constructor Summary
AbstractPage()
           
 
Method Summary
 void addPageListener(PageListener listener)
          Register a PageListener
 long getModCount()
          Get the number of page modifications since its creation.
 Map<String,Object> getProperties()
          Return a map of user properties.
 Map<DocumentLayer,PageSegment> getSegmentMap()
          Return the map of DocumentLayers to PageSegments.
 void removePageListener(PageListener listener)
          Deregister a PageListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.levigo.jadice.document.Page
add, getDocumentLayer, getLayers, getPageSegment, getPageSegments, getSize, remove
 

Field Detail

listenerSupport

protected final com.levigo.jadice.document.PageListenerSupport listenerSupport
Constructor Detail

AbstractPage

public AbstractPage()
Method Detail

addPageListener

public void addPageListener(PageListener listener)
Register a PageListener

Specified by:
addPageListener in interface Page
Parameters:
listener - the listener to register

removePageListener

public void removePageListener(PageListener listener)
Deregister a PageListener

Specified by:
removePageListener in interface Page
Parameters:
listener - the listener to remove

getProperties

public Map<String,Object> getProperties()
Description copied from interface: PropertiesProvider
Return a map of user properties. What to store and which keys to use is largely up to the user of classes implementing this interface, since those classes will generally be oblivious to the map's contents. There are no guarantees regarding the thread-safety of the returned map, unless otherwise specified by implementors.

Specified by:
getProperties in interface PropertiesProvider
Returns:
the map of user properties

getModCount

public long getModCount()
Description copied from interface: Page
Get the number of page modifications since its creation. A modification occurs when a PageSegment is added to or removed from a Page.

Specified by:
getModCount in interface Page
Returns:
number of page modifications

getSegmentMap

public Map<DocumentLayer,PageSegment> getSegmentMap()
Description copied from interface: Page
Return the map of DocumentLayers to PageSegments. Depending on the implementation of this interface, the returned map may be "live" or read-only.

Specified by:
getSegmentMap in interface Page
Returns:
the map of DocumentLayers to PageSegments.


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.