23, February, 2006
This version: h3code_002_003
Authors: Tomokazu ARITA (firstname.lastname@example.org) and and Takeo YAKU (email@example.com)
Copyright © 2002-2006, Tomokazu ARITA and Takeo YAKU. All Rights Reserved.
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.
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.
3. Multiple Linked List for Table
3.1 List-Type Table Strucute Overview
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
5. Inner Data Structure
5.1 Data Structure
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
Here we explane tables and its corresponding graphs.
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
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"
List for Table Strucure (LTS) is the data structures of tables based
Nodes of graphs denotes rectangles (called cell) and edges of graphs are represented by pointers between cells.
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.
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
(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
Figure 3.2: Table（Left） and its corresponding list (right)
A H3-Code is consisted of three files.
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.
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.
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
1. comment line is started from "%".
2.3 2 3
HCContent (.hcc) is a management file for content information.
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.
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"
The extension is ".htl".
In this section, we explain internal data structure of H3-Code.
In this section, we explain package and class structure of H3-Code.
This data structure isrepresented by the package of Java classes.
Figure 5.1 h3code Package (UML Class Diagram)
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.
Class Cell and Interface Content are defined in Figure 5.1
Class Cell can include some Content objects.
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)
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.