HCC-2006-001 (HCC06-001)
WAAP 2003-2006

H3-Code 2.3 Reference Manual

23, February, 2006

This version: h3code_002_003

Authors: Tomokazu ARITA (arita@obirin.ac.jp) and and Takeo YAKU (yaku@cs.chs.nihon-u.ac.jp)

Copyright © 2002-2006, Tomokazu ARITA and Takeo YAKU. All Rights Reserved.

 

Abstract


H3-Code version 2.3 is the specification of data structures and data format for developing table processing systems.
H3-Code consists of list-type data structures for describing tables and data formats for saving their structures.
In Section 2, we review the relations between graphs and tables.
In Section 3, we propose list-type table structures as abstract data structures.
In Section 4, we propose data formats for saving data structures in Section 3.
Finally, we propose internal data structure for implementing by Java in Section 5.


History

H3-Code 2.2 to H2-Code 2.3: we changed order of parameter for east wall edges and west wall edges.
H3-Code 2.1 to H3-Code 2.2: we rewrote this manual from Japanese to Englise.


Table of Contents

1. Introduction
2. Preliminaries

2.1 Tables
2.2 Graphs
3. Multiple Linked List for Table

3.1 List-Type Table Strucute Overview
3.2 Cell
3.3 How To Draw Cells
3.4 Explanation of each part in a cell
3.5 Multiple Linked List for Table
4. H3-Code Data Format

4.1 H3-Code File Structure
4.2 H3-Code(HTC)
4.3 HCContent
4.4 HCTableLayer
5. Inner Data Structure

5.1 Data Structure

5.1.1 Abstruct
5.1.2 Package Structure
5.1.3 Table and Cell
5.1.4 Cell and Contents
5.1.5 Cell and Links
5.1.6 Explanation of Java Classes

5.2 Implementations based on Java

 

1. Introduction

2. Preliminary

Here we explane tables and its corresponding graphs.

2.1 Table

Figure 2.1 is an example of a table.
A table has perimeter cells around inner cells.
The table in Figure 2.1 contains 14 perimeter cells and 4 (inner) cells.

 


Figure 2.1 A Table

2.2 Graph

Structures of tables represent its corresponding graphs.
Figure 2.2 is the graph for the table in Figure 2.1
A node denotes a cell, and a edge represented by a normal or dotted line denotes the relation between cells.


Figure 2.2 " The graph for Fignre 2.1"

3. Data Structures of Tables by Lists

3.1 List for Table Structure

List for Table Strucure (LTS) is the data structures of tables based on graphs.
Nodes of graphs denotes rectangles (called cell) and edges of graphs are represented by pointers between cells.

3.2 Cell

A cell is denoted by a rectangle (as illustrated in Figure 3.1)
The cell includes a following data:
(1) a cell id,
(2) eight pointers beteween cells for edges,
(3) four positions for four walls,
(4) content information in a table cell, and
(5) information for transforming other format of the graph.

3.3 Figures of cells

The cell is represented by a rectanguler in Figure 3.1
The rectangular conteins eight box for pointers and one information box.
The information box can include some information for contents of cells, wall positions, and etc.


Figure 3.1: A cell of LTS

 

 

3.4 Parts in cell

(1) Pointers for connecting cells

nwe_left: pointer of north wall

 
nwe_right: pointer of north wall

 
swe_left: pointer of south wall 

 
swe_right: pointer of south wall

 
wwe_upper: pointer of west wall

 
wwe_lower: pointer of west wall

 
ewe_upper: pointer of east wall 

 
ewe_lower: pointer of east wall 

 

(2)Information in cell

node id: cell id (integer)

 
north wall: 
position of north wall (integer)


south wall: 
position of south wall (integer)

west wall: positoin of east wall (integer)

east wall: position of east wall (integer) 

content: content information (integer) 

align: alignment (integer)

e_point: one of extended information

 

3.5 List for Table Structure


Figure 3.2: Table(Left) and its corresponding list (right)

4. File structure of Lists


4.1 H3-Code File Package

A H3-Code is consisted of three files.

  1. HTC (H-Three-Code)
    HTC includes all cells in a table.
  2. HCContent (Contents List for H3-Code)
    HCContent includes content information.
  3. HCTableLayer(Table Layers for H3-Code)
    HCTableLayer managements relations of tables.

4.2 HTC

HTC is a text file (.htc).
HTC includes a head part and a body part.

(1) Head part
The first line is the head part of a HTC.
This line includes three integer value that are (1)HTC version, (2) row size, and (3) column size.

2.3 2 3
% An Example of a head part
% H3-Code Version=2.3, ROW=2, COLUMN=3

 

(2)Cell part
Cell parts are described next to head part. 
One line in cell part denotes a cell. 

  1. Basic information
    01. node id : node id ( >0 ).
    
    
    02. cell type: 0 denotes perimeter cell, and 1 denotes cell. 
    
    
    03. nwe_left: pointer for north wall that is denoted by node id. 
    
    
    04. swe_left : pointer for south wall that is denoted by node id.
    
    
    05. nwe_right: pointer for north wall that is denoted by node id.
    
    
    06. swe_right: pointer for south wall that is denoted by node id. 
     
    
    07. ewe_upper : pointer for east wall that is denoted by node id.
     
    
    
    08. wwe_upper: pointer for west wall that is denoted by node id.
    
    
    09. ewe_lower : pointer for east wall that is denoted by node id.
     
    
    
    10. wwe_lower : pointer for west wall that is denoted by node id.
    
    
    
    11. north wall : position of north wall (>=0).
     
    
    12. south wall: position of south wall (>=0).
    
    
    13. east wall : position of east wall (>=0). 
    
    
    
    14. west wall: position of west wall (>=0). 
    
    
    15. content id: identification number for content information. 
    0 is null. 
    
    
    16. content align : alignment of content information. 
     
    
    
  2. Extended Information
    Cell lines can be contained a lot of extend data. 
    	 
    	 

 

12 1 16 16 11 11 5 5 17 8 0 50 200 150 0 0 0
% id=12, cell type=Cell, nwe_left=16, ..., north wall=0, south wall = 50, ...

 

 

(3)Other

1. comment line is started from "%".

 

2.3 2 3
%HTC%
1 0 0 0 13 13 0 0 10 10 0 0 0 0 0 0 0
2 0 5 5 0 0 0 0 11 11 0 0 200 200 0 0 0
3 0 0 0 14 14 6 6 0 0 100 100 0 0 0 0 0
4 0 8 8 0 0 7 7 0 0 100 100 200 200 0 0 0
5 0 15 15 2 2 0 0 12 12 0 0 200 150 0 0 0
6 0 0 0 17 9 10 10 3 3 50 100 0 0 0 0 0
7 0 17 17 0 0 11 11 4 4 50 100 200 200 0 0 0
8 0 18 18 4 4 17 12 0 0 100 100 100 50 0 0 0
9 1 10 6 16 17 13 13 14 14 0 100 100 0 0 0 0
10 0 0 0 9 16 1 1 6 6 0 50 0 0 0 0 0
11 0 12 12 0 0 2 2 7 7 0 50 200 200 0 0 0
12 1 16 16 11 11 5 5 17 8 0 50 200 150 0 0 0
13 0 1 1 15 15 0 0 9 9 0 0 100 0 0 0 0
14 0 3 3 18 18 9 9 0 0 100 100 50 0 0 0 0
15 0 13 13 5 5 0 0 16 16 0 0 150 100 0 0 0
16 1 9 10 12 12 15 15 18 17 0 50 150 100 0 0 0
17 1 6 9 7 7 12 16 8 18 50 100 200 100 0 0 0
18 0 14 14 8 8 16 17 0 0 100 100 50 50 0 0 0
%HTC%


4.3 HCContent:

HCContent (.hcc) is a management file for content information.

(1)Head Part
The head part of HCContent is described on the first line.
Space symbols partition off the head part into 3 parts as following:
(1) H3-Code version and (2) the number of contents in this file.

(2)Content Part
One line denotes one content.
A content line consists of next data: 1. content id : the identification number of a content. this value is more than 1. 2. content type :
This value expresses the data type of this content.
This value is an integer number as following:
Type 1: TEXT (=1) Type 2: HTML (=100)
Type 3: RFT (=101) Type 4: One Line Text (=5)
3. object : a character string for a content or a path of a content. Example:"link:./sample.gif"

4.4 HCTableLayer: the layer management file of H3-Code tables.


The extension is ".htl".


5. Internal Data Structure

In this section, we explain internal data structure of H3-Code.


5.1 Data Structure

In this section, we explain package and class structure of H3-Code.

5.1.1 Overview

This data structure isrepresented by the package of Java classes.

5.1.2 h3code Package


Figure 5.1 h3code Package (UML Class Diagram)

5.1.3 TableとCell

Table class and Cell class have the relation in Figure 5.1

Table class contain some PerimeterCell and Cell classes.

Here, we explain tables.
Figure 5.2 is an explain of a table.
Perimeter cells are colored rectangles.
Four terminal cells that are colored red are reserved perimeter cellls.
These reserved perimeter cells have reserved identification numbers to be illustrated in Figure 5.2


Figure 5.2: A Table(Left) and Cells(Right)

 

Figure 5.3 is a table and its corresponding array representation of cells.
Indexes of this array correspond to id number of cells.


Figure 5.3: a table and its corresponding array of cells.

There is two methods for array to access to No.1 and 4 perimeter cells.
The method "getHead()" returns No.1 perimeter cell and the method "getTail" return No.4 cell.

5.1.4 Cell and Content

Class Cell and Interface Content are defined in Figure 5.1
Class Cell can include some Content objects.

5.1.5 Cell and Linkes

AbstractCell is for a cell and has some fields for wall positions.
To make instances of AbstractCell, we use Cell.class or PerimeterCell.class.
By using getWall() method, we get the value of a wall position.

Figure 5.4 shows the relation of instance c of Cell.class and fields of c.


Figure 5.4 A Cell and Its Wall Positions

Figure 5.5 illustrates an AbstractLinkedNode.class.
AbstractLinkedNode has eight pointers for linking adjcent cells.
These pointers are linked based on rules for connecting walls.




Figure 5.5 A Illustration of Cell (AbstractLinkedNode.class)

Fighre 5.6 illustrates a list-type data structure of a table.


Figure 5.6: Table(Left) and its corresponding graph(Right)

 

5.1.6 Class Diagrams of H3-Code

 

AbstractLinkedNode


AbstractCell

 

Cell

 

PerimeterCell

 

Content

 

Table

 

AbstractContentTypeTable

 


5.2 H3-Code Java Package

h3code package : http://hichart.yaku.cs.chs.nihon-u.ac.jp/waap/waap-rr/waap-rr-05-003/index.html
Copyright © 2002-2006 Tomokazu ARITA. All Rights Reserved.
Licence: GPL.
Mail: arita@obirin.ac.jp