Granule Code
From DocDataFlow
The Granule class is the root class from which all granule types are derived.
It has a class identifier of com.rorohiko.granule
Granules are 'constant': once created they don't change. Any 'live' data related to the granule is carried in the associated context data structure.
It has the following methods:
-
granule.getId()
: get the unique identifier for this granule.
-
granule.getContext()
: retrieve the context for this granule.
-
granule.getData()
: retrieve the core data for this granule. In most cases this is a reference to the document-specific data structure for the granule. E.g. if the granule is an InDesignTextFrameGranule, the granule.getData() will retrieve the associated InDesign TextFrame object (or a proxy thereof).
-
granule.getParentGranule()
: retrieve the parent granule for this granule. Eventually will lead to an AppGranule - appGranules are the root(s) for the granule hierarchy.
-
granule.comparePosition(orderingList, compareWithGranule)
: return an int (< 0, == 0, > 0) after comparing the granules. The orderingList is a linear list of granule ordering.