KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > elementprocessor > impl > poi > hssf > elements > EPSelection


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

16
17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
18
19 import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
20 import org.apache.cocoon.components.elementprocessor.types.NumericResult;
21
22 import java.io.IOException JavaDoc;
23
24 /**
25  * No-op implementation of ElementProcessor to handle the
26  * "Selection" tag
27  *
28  * This element is a container of other elements and has four
29  * attributes that define the boundaries of the region.
30  *
31  * This element is not used in HSSFSerializer 1.0
32  *
33  * @author Marc Johnson (marc_johnson27591@hotmail.com)
34  * @version CVS $Id: EPSelection.java 30932 2004-07-29 17:35:38Z vgritsenko $
35  */

36 public class EPSelection extends BaseElementProcessor {
37     private static final String JavaDoc _start_col_attribute = "startCol";
38     private static final String JavaDoc _start_row_attribute = "startRow";
39     private static final String JavaDoc _end_col_attribute = "endCol";
40     private static final String JavaDoc _end_row_attribute = "endRow";
41     private NumericResult _start_col;
42     private NumericResult _start_row;
43     private NumericResult _end_col;
44     private NumericResult _end_row;
45
46     /**
47      * constructor
48      */

49     public EPSelection() {
50         super(null);
51         _start_col = null;
52         _start_row = null;
53         _end_col = null;
54         _end_row = null;
55     }
56
57     /**
58      * @return start row
59      * @exception IOException
60      */

61     public int getStartRow() throws IOException JavaDoc {
62         if (_start_row == null) {
63             _start_row = NumericConverter.extractNonNegativeInteger(
64                     getValue(_start_row_attribute));
65         }
66         return _start_row.intValue();
67     }
68
69     /**
70      * @return start column
71      * @exception IOException
72      */

73     public int getStartCol() throws IOException JavaDoc {
74         if (_start_col == null) {
75             _start_col = NumericConverter.extractNonNegativeInteger(
76                     getValue(_start_col_attribute));
77         }
78         return _start_col.intValue();
79     }
80
81     /**
82      * @return end row
83      * @exception IOException
84      */

85     public int getEndRow() throws IOException JavaDoc {
86         if (_end_row == null) {
87             _end_row = NumericConverter.extractNonNegativeInteger(
88                     getValue(_end_row_attribute));
89         }
90         return _end_row.intValue();
91     }
92
93     /**
94      * @return end column
95      * @exception IOException
96      */

97     public int getEndCol() throws IOException JavaDoc {
98         if (_end_col == null) {
99             _end_col = NumericConverter.extractNonNegativeInteger(
100                     getValue(_end_col_attribute));
101         }
102         return _end_col.intValue();
103     }
104 } // end public class EPSelection
105
Popular Tags