286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: SortSettings.java,v 1.2.4.1 2005/09/06 10:19:22 pvedula Exp $
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xalan.internal.xsltc.dom;
286N/A
286N/Aimport java.text.Collator;
286N/Aimport java.util.Locale;
286N/A
286N/Aimport com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
286N/A
286N/A/**
286N/A * Class for carrying settings that are to be used for a particular set
286N/A * of <code>xsl:sort</code> elements.
286N/A */
286N/Afinal class SortSettings {
286N/A /**
286N/A * A reference to the translet object for the transformation.
286N/A */
286N/A private AbstractTranslet _translet;
286N/A
286N/A /**
286N/A * The sort order (ascending or descending) for each level of
286N/A * <code>xsl:sort</code>
286N/A */
286N/A private int[] _sortOrders;
286N/A
286N/A /**
286N/A * The type of comparison (text or number) for each level of
286N/A * <code>xsl:sort</code>
286N/A */
286N/A private int[] _types;
286N/A
286N/A /**
286N/A * The Locale for each level of <code>xsl:sort</code>, based on any lang
286N/A * attribute or the default Locale.
286N/A */
286N/A private Locale[] _locales;
286N/A
286N/A /**
286N/A * The Collator object in effect for each level of <code>xsl:sort</code>
286N/A */
286N/A private Collator[] _collators;
286N/A
286N/A /**
286N/A * Case ordering for each level of <code>xsl:sort</code>.
286N/A */
286N/A private String[] _caseOrders;
286N/A
286N/A /**
286N/A * Create an instance of <code>SortSettings</code>.
286N/A * @param translet {@link com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet}
286N/A * object for the transformation
286N/A * @param sortOrders an array specifying the sort order for each sort level
286N/A * @param types an array specifying the type of comparison for each sort
286N/A * level (text or number)
286N/A * @param locales an array specifying the Locale for each sort level
286N/A * @param collators an array specifying the Collation in effect for each
286N/A * sort level
286N/A * @param caseOrders an array specifying whether upper-case, lower-case
286N/A * or neither is to take precedence for each sort level.
286N/A * The value of each element is equal to one of
286N/A * <code>"upper-first", "lower-first", or ""</code>.
286N/A */
286N/A SortSettings(AbstractTranslet translet, int[] sortOrders, int[] types,
286N/A Locale[] locales, Collator[] collators, String[] caseOrders) {
286N/A _translet = translet;
286N/A _sortOrders = sortOrders;
286N/A _types = types;
286N/A _locales = locales;
286N/A _collators = collators;
286N/A _caseOrders = caseOrders;
286N/A }
286N/A
286N/A /**
286N/A * @return A reference to the translet object for the transformation.
286N/A */
286N/A AbstractTranslet getTranslet() {
286N/A return _translet;
286N/A }
286N/A
286N/A /**
286N/A * @return An array containing the sort order (ascending or descending)
286N/A * for each level of <code>xsl:sort</code>
286N/A */
286N/A int[] getSortOrders() {
286N/A return _sortOrders;
286N/A }
286N/A
286N/A /**
286N/A * @return An array containing the type of comparison (text or number)
286N/A * to perform for each level of <code>xsl:sort</code>
286N/A */
286N/A int[] getTypes() {
286N/A return _types;
286N/A }
286N/A
286N/A /**
286N/A * @return An array containing the Locale object in effect for each level
286N/A * of <code>xsl:sort</code>
286N/A */
286N/A Locale[] getLocales() {
286N/A return _locales;
286N/A }
286N/A
286N/A /**
286N/A * @return An array containing the Collator object in effect for each level
286N/A * of <code>xsl:sort</code>
286N/A */
286N/A Collator[] getCollators() {
286N/A return _collators;
286N/A }
286N/A
286N/A /**
286N/A * @return An array specifying the case ordering for each level of
286N/A * <code>xsl:sort</code>.
286N/A */
286N/A String[] getCaseOrders() {
286N/A return _caseOrders;
286N/A }
286N/A}