1 16 17 package org.apache.xerces.impl.xs.util; 18 19 import java.util.Vector ; 20 21 import org.apache.xerces.xs.XSNamespaceItem; 22 import org.apache.xerces.xs.XSNamespaceItemList; 23 32 public class NSItemListImpl implements XSNamespaceItemList { 33 34 private XSNamespaceItem[] fArray = null; 36 private int fLength = 0; 38 39 private Vector fVector; 42 43 public NSItemListImpl(Vector v) { 44 fVector = v; 45 fLength = v.size(); 46 } 47 48 54 public NSItemListImpl(XSNamespaceItem[] array, int length) { 55 fArray = array; 56 fLength = length; 57 } 58 59 63 public int getLength() { 64 return fLength; 65 } 66 67 public XSNamespaceItem item(int index) { 68 if (index < 0 || index >= fLength) 69 return null; 70 if (fVector != null) { 71 return (XSNamespaceItem)fVector.elementAt(index); 72 } 73 return fArray[index]; 74 } 75 76 } | Popular Tags |