KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xs > ShortList


1 /*
2  * Copyright 2003,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.xerces.xs;
18
19 /**
20  * The <code>ShortList</code> is an immutable ordered collection of
21  * <code>unsigned short</code>.
22  */

23 public interface ShortList {
24     /**
25      * The number of <code>unsigned short</code>s in the list. The range of
26      * valid child object indices is 0 to <code>length-1</code> inclusive.
27      */

28     public int getLength();
29
30     /**
31      * Checks if the <code>unsigned short</code> <code>item</code> is a
32      * member of this list.
33      * @param item <code>unsigned short</code> whose presence in this list
34      * is to be tested.
35      * @return True if this list contains the <code>unsigned short</code>
36      * <code>item</code>.
37      */

38     public boolean contains(short item);
39
40     /**
41      * Returns the <code>index</code>th item in the collection. The index
42      * starts at 0.
43      * @param index index into the collection.
44      * @return The <code>unsigned short</code> at the <code>index</code>th
45      * position in the <code>ShortList</code>.
46      * @exception XSException
47      * INDEX_SIZE_ERR: if <code>index</code> is greater than or equal to the
48      * number of objects in the list.
49      */

50     public short item(int index)
51                       throws XSException;
52
53 }
54
Popular Tags