src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
changeset 47359 e1a6c0168741
parent 47216 71c04702a3d5
child 48409 5ab69533994b
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
       
     3  * @LastModified: Oct 2017
     3  */
     4  */
     4 /*
     5 /*
     5  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * contributor license agreements.  See the NOTICE file distributed with
     7  * contributor license agreements.  See the NOTICE file distributed with
     7  * this work for additional information regarding copyright ownership.
     8  * this work for additional information regarding copyright ownership.
    18  * limitations under the License.
    19  * limitations under the License.
    19  */
    20  */
    20 
    21 
    21 package com.sun.org.apache.xerces.internal.impl.xs.util;
    22 package com.sun.org.apache.xerces.internal.impl.xs.util;
    22 
    23 
    23 import java.util.AbstractList;
       
    24 
       
    25 import com.sun.org.apache.xerces.internal.xs.ShortList;
    24 import com.sun.org.apache.xerces.internal.xs.ShortList;
    26 import com.sun.org.apache.xerces.internal.xs.XSException;
    25 import com.sun.org.apache.xerces.internal.xs.XSException;
       
    26 import java.util.AbstractList;
    27 
    27 
    28 /**
    28 /**
    29  * Containts a list of Object's.
    29  * Containts a list of Object's.
    30  *
    30  *
    31  * @xerces.internal
    31  * @xerces.internal
    32  *
    32  *
    33  * @author Sandy Gao, IBM
    33  * @author Sandy Gao, IBM
    34  *
    34  *
    35  */
    35  */
    36 public final class ShortListImpl extends AbstractList implements ShortList {
    36 public final class ShortListImpl extends AbstractList<Short> implements ShortList {
    37 
    37 
    38     /**
    38     /**
    39      * An immutable empty list.
    39      * An immutable empty list.
    40      */
    40      */
    41     public static final ShortListImpl EMPTY_LIST = new ShortListImpl(new short[0], 0);
    41     public static final ShortListImpl EMPTY_LIST = new ShortListImpl(new short[0], 0);
   107 
   107 
   108     /*
   108     /*
   109      * List methods
   109      * List methods
   110      */
   110      */
   111 
   111 
   112     public Object get(int index) {
   112     public Short get(int index) {
   113         if (index >= 0 && index < fLength) {
   113         if (index >= 0 && index < fLength) {
   114             return fArray[index];
   114             return fArray[index];
   115         }
   115         }
   116         throw new IndexOutOfBoundsException("Index: " + index);
   116         throw new IndexOutOfBoundsException("Index: " + index);
   117     }
   117     }