FileDocCategorySizeDatePackage
StringListImpl.javaAPI DocApache Xerces 3.0.13568Fri Sep 14 20:33:54 BST 2007org.apache.xerces.impl.xs.util

StringListImpl

public class StringListImpl extends Object implements org.apache.xerces.xs.StringList
Containts a list of Object's.
xerces.internal
author
Sandy Gao, IBM
version
$Id: StringListImpl.java 446723 2006-09-15 20:37:45Z mrglavas $

Fields Summary
public static final org.apache.xerces.xs.StringList
EMPTY_LIST
An immutable empty list.
private String[]
fArray
private int
fLength
private Vector
fVector
Constructors Summary
public StringListImpl(Vector v)


       
        fVector = v;        
        fLength = (v == null) ? 0 : v.size();
    
public StringListImpl(String[] 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(java.lang.String item)
Checks if the GenericString item is a member of this list.

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

        if (fVector != null)
            return fVector.contains(item);
        
        if (item == null) {
            for (int i = 0; i < fLength; i++) {
                if (fArray[i] == null)
                    return true;
            }
        }
        else {
            for (int i = 0; i < fLength; i++) {
                if (item.equals(fArray[i]))
                    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 java.lang.Stringitem(int index)

        if (index < 0 || index >= fLength)
            return null;
        if (fVector != null) {
            return (String)fVector.elementAt(index);
        }
        return fArray[index];