Granule Code

From DocDataFlow
Revision as of 01:56, 30 December 2013 by Kris (Talk | contribs)

Jump to: navigation, search

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).