1 57 58 package com.sun.org.apache.xerces.internal.impl.xs.util; 59 60 import com.sun.org.apache.xerces.internal.xs.ShortList; 61 import com.sun.org.apache.xerces.internal.xs.XSException; 62 63 70 public class ShortListImpl implements ShortList { 71 72 private short[] fArray = null; 74 private int fLength = 0; 76 77 83 public ShortListImpl(short[] array, int length) { 84 fArray = array; 85 fLength = length; 86 } 87 88 92 public int getLength() { 93 return fLength; 94 } 95 96 104 public boolean contains(short item) { 105 for (int i = 0; i < fLength; i++) { 106 if (fArray[i] == item) 107 return true; 108 } 109 return false; 110 } 111 112 public short item(int index) throws XSException { 113 if (index < 0 || index >= fLength) 114 throw new XSException(XSException.INDEX_SIZE_ERR, null); 115 return fArray[index]; 116 } 117 118 } | Popular Tags |