KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xalan > internal > xsltc > dom > SortSettings


1 /*
2  * Copyright 2001-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  * $Id: SortSettings.java,v 1.1 2004/02/27 01:58:29 zongaro Exp $
18  */

19
20 package com.sun.org.apache.xalan.internal.xsltc.dom;
21
22 import java.text.Collator JavaDoc;
23 import java.util.Locale JavaDoc;
24
25 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
26
27 /**
28  * Class for carrying settings that are to be used for a particular set
29  * of <code>xsl:sort</code> elements.
30  */

31 final class SortSettings {
32     /**
33      * A reference to the translet object for the transformation.
34      */

35     private AbstractTranslet _translet;
36
37     /**
38      * The sort order (ascending or descending) for each level of
39      * <code>xsl:sort</code>
40      */

41     private int[] _sortOrders;
42
43     /**
44      * The type of comparison (text or number) for each level of
45      * <code>xsl:sort</code>
46      */

47     private int[] _types;
48
49     /**
50      * The Locale for each level of <code>xsl:sort</code>, based on any lang
51      * attribute or the default Locale.
52      */

53     private Locale JavaDoc[] _locales;
54
55     /**
56      * The Collator object in effect for each level of <code>xsl:sort</code>
57      */

58     private Collator JavaDoc[] _collators;
59
60     /**
61      * Case ordering for each level of <code>xsl:sort</code>.
62      */

63     private String JavaDoc[] _caseOrders;
64
65     /**
66      * Create an instance of <code>SortSettings</code>.
67      * @param translet {@link com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet}
68      * object for the transformation
69      * @param sortOrders an array specifying the sort order for each sort level
70      * @param types an array specifying the type of comparison for each sort
71      * level (text or number)
72      * @param locales an array specifying the Locale for each sort level
73      * @param collators an array specifying the Collation in effect for each
74      * sort level
75      * @param caseOrders an array specifying whether upper-case, lower-case
76      * or neither is to take precedence for each sort level.
77      * The value of each element is equal to one of
78      * <code>"upper-first", "lower-first", or ""</code>.
79      */

80     SortSettings(AbstractTranslet translet, int[] sortOrders, int[] types,
81                  Locale JavaDoc[] locales, Collator JavaDoc[] collators, String JavaDoc[] caseOrders) {
82         _translet = translet;
83         _sortOrders = sortOrders;
84         _types = types;
85         _locales = locales;
86         _collators = collators;
87         _caseOrders = caseOrders;
88     }
89
90     /**
91      * @return A reference to the translet object for the transformation.
92      */

93     AbstractTranslet getTranslet() {
94         return _translet;
95     }
96
97     /**
98      * @return An array containing the sort order (ascending or descending)
99      * for each level of <code>xsl:sort</code>
100      */

101     int[] getSortOrders() {
102         return _sortOrders;
103     }
104
105     /**
106      * @return An array containing the type of comparison (text or number)
107      * to perform for each level of <code>xsl:sort</code>
108      */

109     int[] getTypes() {
110         return _types;
111     }
112
113     /**
114      * @return An array containing the Locale object in effect for each level
115      * of <code>xsl:sort</code>
116      */

117     Locale JavaDoc[] getLocales() {
118         return _locales;
119     }
120
121     /**
122      * @return An array containing the Collator object in effect for each level
123      * of <code>xsl:sort</code>
124      */

125     Collator JavaDoc[] getCollators() {
126         return _collators;
127     }
128
129     /**
130      * @return An array specifying the case ordering for each level of
131      * <code>xsl:sort</code>.
132      */

133     String JavaDoc[] getCaseOrders() {
134         return _caseOrders;
135     }
136 }
137
Popular Tags