src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
equal
deleted
inserted
replaced
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.dv.util; |
22 package com.sun.org.apache.xerces.internal.impl.dv.util; |
22 |
23 |
23 import java.util.AbstractList; |
|
24 |
|
25 import com.sun.org.apache.xerces.internal.xs.XSException; |
24 import com.sun.org.apache.xerces.internal.xs.XSException; |
26 import com.sun.org.apache.xerces.internal.xs.datatypes.ByteList; |
25 import com.sun.org.apache.xerces.internal.xs.datatypes.ByteList; |
|
26 import java.util.AbstractList; |
27 |
27 |
28 /** |
28 /** |
29 * Implementation of <code>com.sun.org.apache.xerces.internal.xs.datatypes.ByteList</code>. |
29 * Implementation of <code>com.sun.org.apache.xerces.internal.xs.datatypes.ByteList</code>. |
30 * |
30 * |
31 * @xerces.internal |
31 * @xerces.internal |
32 * |
32 * |
33 * @author Ankit Pasricha, IBM |
33 * @author Ankit Pasricha, IBM |
34 * |
34 * |
35 */ |
35 */ |
36 public class ByteListImpl extends AbstractList implements ByteList { |
36 public class ByteListImpl extends AbstractList<Byte> implements ByteList { |
37 |
37 |
38 // actually data stored in a byte array |
38 // actually data stored in a byte array |
39 protected final byte[] data; |
39 protected final byte[] data; |
40 |
40 |
41 // canonical representation of the data |
41 // canonical representation of the data |
91 |
91 |
92 /* |
92 /* |
93 * List methods |
93 * List methods |
94 */ |
94 */ |
95 |
95 |
96 public Object get(int index) { |
96 public Byte get(int index) { |
97 if (index >= 0 && index < data.length) { |
97 if (index >= 0 && index < data.length) { |
98 return data[index]; |
98 return data[index]; |
99 } |
99 } |
100 throw new IndexOutOfBoundsException("Index: " + index); |
100 throw new IndexOutOfBoundsException("Index: " + index); |
101 } |
101 } |