Module utilities

Class HierarchicalQueue

All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, AutoCloseable
Direct Known Subclasses:
GraphQueue, XAQueue

public class HierarchicalQueue extends OutputQueue implements ObjectOutput
A HierarchicalQueue equips an OutputQueue with a record-like, hierarchical structure. Each record is called an item, the type of which is identified by the first int-value of the record. Items follow each other in a linked list (the link is established by relative addresses which are stored in an item's header structure, see below). The item of type BEGIN_LEVEL indicates a nesting of items, it contains another linked list of items.

A whole item is represented by the following structure in the int-queue:

  1. int-value at offset 0: item type
  2. int-value at offset 1: difference between this item's address (the absolute index of offset 0) and the address of the previous item. If no previous item exists, -1 is used for the latter address. The first item which is contained in a new level has no previous item.
  3. The following ints contain the total number of int, byte, long, float, double, Object-values in this order. If the total number of values of one of these types is always the same for the item type, this number is not present in the structure. The total number of values for an item type is set by the method setItemSize(int, int, int, int, int, int, int).
  4. The following ints represent the data of the item in its specific format

An item of type BEGIN_LEVEL is used to store the whole information of the nested items it contains. It uses an additional int-value as first value of its data: Its value is the difference between the address of the last contained item and this item.

Author:
Ole Kniemeyer