FileDocCategorySizeDatePackage
ShortListImpl.javaAPI DocJava SE 5 API4441Fri Aug 26 14:55:52 BST 2005com.sun.org.apache.xerces.internal.impl.xs.util

ShortListImpl

public class ShortListImpl extends Object implements ShortList
Containts a list of Object's.
author
Sandy Gao, IBM
version
$Id: ShortListImpl.java,v 1.1 2003/11/12 23:17:34 sandygao Exp $

Fields Summary
private short[]
fArray
private int
fLength
Constructors Summary
public ShortListImpl(short[] array, int length)
Construct an XSObjectList implementation

param
array the data array
param
length the number of elements


                                
         
        fArray = array;
        fLength = length;
    
Methods Summary
public booleancontains(short item)
Checks if the unsigned short item is a member of this list.

param
item unsigned short whose presence in this list is to be tested.
return
True if this list contains the unsigned short item.

        for (int i = 0; i < fLength; i++) {
            if (fArray[i] == item)
                return true;
        }
        return false;
    
public intgetLength()
The number of Objects in the list. The range of valid child node indices is 0 to length-1 inclusive.

        return fLength;
    
public shortitem(int index)

        if (index < 0 || index >= fLength)
            throw new XSException(XSException.INDEX_SIZE_ERR, null);
        return fArray[index];