[top] | [previous] | [next] |
28, September, 2005
This version: http://www.yaku.cs.chs.nihon-u.ac.jp/tech_note/2003/hcc03-001/h3c10-030828/
Authors: Tomokazu ARITA (arita@obirin.ac.jp) and and Takeo YAKU (yaku@cs.chs.nihon-u.ac.jp)
Copyright © 2002-2003, Tomokazu ARITA and Takeo YAKU. All Rights Reserved.
H3-Code version 2.2 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.
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
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
on graphs.
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.
1 3 3 % An Example of a head part % H3-Code Version=1.0, ROW=3, 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. wwe_upper: pointer for west wall that is denoted by node id. 08. ewe_upper : pointer for east wall that is denoted by node id. 09. wwe_lower : pointer for west wall that is denoted by node id. 10. ewe_lower : pointer for east wall that is denoted by node id. 11. north wall : position of north wall (>=0). 12. south wall: position of south wall (>=0). 13. west wall: position of west wall (>=0). 14. east wall : position of east 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.
10 1 9 6 11 12 7 20 17 14 100 200 100 200 0 0 0 |
(3)Other
1. comment line is started from "%".
1 3 3 1 0 0 0 19 19 0 0 5 5 0 0 0 0 0 0 0 2 0 21 21 0 0 0 0 8 8 0 0 0 0 0 0 0 3 0 0 0 16 16 13 13 0 0 0 0 0 0 0 0 0 4 0 18 18 0 0 15 15 0 0 0 0 0 0 0 0 0 5 0 0 0 6 7 1 1 9 9 0 0 0 0 0 0 0 6 1 5 9 7 10 19 19 10 16 0 200 0 100 0 0 0 7 1 6 5 8 8 20 21 10 11 0 100 100 300 0 0 0 8 0 7 7 0 0 2 2 12 12 0 0 0 0 0 0 0 9 0 0 0 10 6 5 5 13 13 0 0 0 0 0 0 0 10 1 9 6 11 12 7 20 17 14 100 200 100 200 0 0 0 11 1 10 14 12 15 21 7 18 18 100 300 200 300 0 0 0 12 0 11 10 0 0 8 8 15 15 0 0 0 0 0 0 0 13 0 0 0 14 14 9 9 3 3 0 0 0 0 0 0 0 14 1 13 13 15 11 6 10 16 17 200 300 0 200 0 0 0 15 0 14 11 0 0 12 12 4 4 0 0 0 0 0 0 0 16 0 3 3 17 17 14 16 0 0 0 0 0 0 0 0 0 17 0 16 16 18 18 10 14 0 0 0 0 0 0 0 0 0 18 0 17 17 4 4 11 11 0 0 0 0 0 0 0 0 0 19 0 1 1 20 20 0 0 6 6 0 0 0 0 0 0 0 20 0 19 19 21 21 0 0 7 10 0 0 0 0 0 0 0 21 0 20 20 2 2 0 0 10 7 0 0 0 0 0 0 0 %HLTC |
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)
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 : LITE 1.0
Copyright © 2003 Tomokazu ARITA. All Rights Reserved.
Licence: GPL.
Mail: arita@obirin.ac.jp