short val = vsb.getValueTypeAt(i);
if (!valueTypeContains(val) || !fValues.contains(values.elementAt(i))) {
return i;
}
else if(val == XSConstants.LIST_DT || val == XSConstants.LISTOFUNION_DT) {
ShortList list1 = vsb.getItemValueTypeAt(i);
if (!itemValueTypeContains(list1)) {
return i;
}
}
}
}
/** Handle n-tuples. **/
else {
final int size2 = fValues.size();
/** Iterate over each set of fields. **/
OUTER: for (int i = 0; i < size1; i += fFieldCount) {
/** Check whether this set is contained in the value store. **/
INNER: for (int j = 0; j < size2; j += fFieldCount) {
for (int k = 0; k < fFieldCount; ++k) {
final Object value1 = values.elementAt(i+k);
final Object value2 = fValues.elementAt(j+k);
final short valueType1 = vsb.getValueTypeAt(i+k);
final short valueType2 = getValueTypeAt(j+k);
if (value1 != value2 && (valueType1 != valueType2 || value1 == null || !value1.equals(value2))) {
continue INNER;
}
else if(valueType1 == XSConstants.LIST_DT || valueType1 == XSConstants.LISTOFUNION_DT) {
ShortList list1 = vsb.getItemValueTypeAt(i+k);
ShortList list2 = getItemValueTypeAt(j+k);
if (list1 == null || list2 == null || !list1.equals(list2)) {
continue INNER;
}
}
}