KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hpsf > SpecialPropertySet


1
2 /* ====================================================================
3    Copyright 2002-2004 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.poi.hpsf;
19
20 import java.util.List JavaDoc;
21
22 /**
23  * <p>Abstract superclass for the convenience classes {@link
24  * SummaryInformation} and {@link DocumentSummaryInformation}.</p>
25  *
26  * <p>The motivation behind this class is quite nasty if you look
27  * behind the scenes, but it serves the application programmer well by
28  * providing him with the easy-to-use {@link SummaryInformation} and
29  * {@link DocumentSummaryInformation} classes. When parsing the data a
30  * property set stream consists of (possibly coming from an {@link
31  * java.io.InputStream}) we want to read and process each byte only
32  * once. Since we don't know in advance which kind of property set we
33  * have, we can expect only the most general {@link
34  * PropertySet}. Creating a special subclass should be as easy as
35  * calling the special subclass' constructor and pass the general
36  * {@link PropertySet} in. To make things easy internally, the special
37  * class just holds a reference to the general {@link PropertySet} and
38  * delegates all method calls to it.</p>
39  *
40  * <p>A cleaner implementation would have been like this: The {@link
41  * PropertySetFactory} parses the stream data into some internal
42  * object first. Then it finds out whether the stream is a {@link
43  * SummaryInformation}, a {@link DocumentSummaryInformation} or a
44  * general {@link PropertySet}. However, the current implementation
45  * went the other way round historically: the convenience classes came
46  * only late to my mind.</p>
47  *
48  * @author Rainer Klute <a
49  * HREF="mailto:klute@rainer-klute.de">&lt;klute@rainer-klute.de&gt;</a>
50  * @version $Id: SpecialPropertySet.java,v 1.11 2004/04/09 13:05:16 glens Exp $
51  * @since 2002-02-09
52  */

53 public abstract class SpecialPropertySet extends PropertySet
54 {
55
56     /**
57      * <p>The "real" property set <code>SpecialPropertySet</code>
58      * delegates to.</p>
59      */

60     private PropertySet delegate;
61
62
63
64     /**
65      * <p>Creates a <code>SpecialPropertySet</code>.
66      *
67      * @param ps The property set encapsulated by the
68      * <code>SpecialPropertySet</code>
69      */

70     public SpecialPropertySet(final PropertySet ps)
71     {
72         delegate = ps;
73     }
74
75
76
77     /**
78      * @see PropertySet#getByteOrder
79      */

80     public int getByteOrder()
81     {
82         return delegate.getByteOrder();
83     }
84
85
86
87     /**
88      * @see PropertySet#getFormat
89      */

90     public int getFormat()
91     {
92         return delegate.getFormat();
93     }
94
95
96
97     /**
98      * @see PropertySet#getOSVersion
99      */

100     public int getOSVersion()
101     {
102         return delegate.getOSVersion();
103     }
104
105
106
107     /**
108      * @see PropertySet#getClassID
109      */

110     public ClassID getClassID()
111     {
112         return delegate.getClassID();
113     }
114
115
116
117     /**
118      * @see PropertySet#getSectionCount
119      */

120     public int getSectionCount()
121     {
122         return delegate.getSectionCount();
123     }
124
125
126
127     /**
128      * @see PropertySet#getSections
129      */

130     public List JavaDoc getSections()
131     {
132         return delegate.getSections();
133     }
134
135
136
137     /**
138      * @see PropertySet#isSummaryInformation
139      */

140     public boolean isSummaryInformation()
141     {
142         return delegate.isSummaryInformation();
143     }
144
145
146
147     /**
148      * @see PropertySet#isDocumentSummaryInformation
149      */

150     public boolean isDocumentSummaryInformation()
151     {
152         return delegate.isDocumentSummaryInformation();
153     }
154
155
156
157     /**
158      * @see PropertySet#getSingleSection
159      */

160     public Section getSingleSection()
161     {
162         return delegate.getSingleSection();
163     }
164
165 }
166
Popular Tags