KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > svggen > font > table > DirectoryEntry


1 /*
2
3    Copyright 2001 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.svggen.font.table;
19
20 import java.io.IOException JavaDoc;
21 import java.io.RandomAccessFile JavaDoc;
22
23 /**
24  * @version $Id: DirectoryEntry.java,v 1.3 2004/08/18 07:15:20 vhardy Exp $
25  * @author <a HREF="mailto:david@steadystate.co.uk">David Schweinsberg</a>
26  */

27 public class DirectoryEntry {
28
29     private int tag;
30     private int checksum;
31     private int offset;
32     private int length;
33     private Table table = null;
34
35     protected DirectoryEntry(RandomAccessFile JavaDoc raf) throws IOException JavaDoc {
36         tag = raf.readInt();
37         checksum = raf.readInt();
38         offset = raf.readInt();
39         length = raf.readInt();
40     }
41
42     public int getChecksum() {
43         return checksum;
44     }
45
46     public int getLength() {
47         return length;
48     }
49
50     public int getOffset() {
51         return offset;
52     }
53
54     public int getTag() {
55         return tag;
56     }
57
58     public String JavaDoc toString() {
59         return new StringBuffer JavaDoc()
60             .append((char)((tag>>24)&0xff))
61             .append((char)((tag>>16)&0xff))
62             .append((char)((tag>>8)&0xff))
63             .append((char)((tag)&0xff))
64             .append(", offset: ")
65             .append(offset)
66             .append(", length: ")
67             .append(length)
68             .append(", checksum: 0x")
69             .append(Integer.toHexString(checksum))
70             .toString();
71     }
72 }
73
Popular Tags