public XSWildcardDecl performIntersectionWith(XSWildcardDecl wildcard,short processContents){
  if (wildcard == null)   return null;
  XSWildcardDecl intersectWildcard=new XSWildcardDecl();
  intersectWildcard.fProcessContents=processContents;
  if (areSame(wildcard)) {
    intersectWildcard.fType=fType;
    intersectWildcard.fNamespaceList=fNamespaceList;
  }
 else   if ((fType == NSCONSTRAINT_ANY) || (wildcard.fType == NSCONSTRAINT_ANY)) {
    XSWildcardDecl other=this;
    if (fType == NSCONSTRAINT_ANY)     other=wildcard;
    intersectWildcard.fType=other.fType;
    intersectWildcard.fNamespaceList=other.fNamespaceList;
  }
 else   if (((fType == NSCONSTRAINT_NOT) && (wildcard.fType == NSCONSTRAINT_LIST)) || ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_NOT))) {
    String[] list=null;
    String[] other=null;
    if (fType == NSCONSTRAINT_NOT) {
      other=fNamespaceList;
      list=wildcard.fNamespaceList;
    }
 else {
      other=wildcard.fNamespaceList;
      list=fNamespaceList;
    }
    int listSize=list.length;
    String[] intersect=new String[listSize];
    int newSize=0;
    for (int i=0; i < listSize; i++) {
      if (list[i] != other[0] && list[i] != ABSENT)       intersect[newSize++]=list[i];
    }
    intersectWildcard.fType=NSCONSTRAINT_LIST;
    intersectWildcard.fNamespaceList=new String[newSize];
    System.arraycopy(intersect,0,intersectWildcard.fNamespaceList,0,newSize);
  }
 else   if ((fType == NSCONSTRAINT_LIST) && (wildcard.fType == NSCONSTRAINT_LIST)) {
    intersectWildcard.fType=NSCONSTRAINT_LIST;
    intersectWildcard.fNamespaceList=intersect2sets(fNamespaceList,wildcard.fNamespaceList);
  }
 else   if (fType == NSCONSTRAINT_NOT && wildcard.fType == NSCONSTRAINT_NOT) {
    if (fNamespaceList[0] != ABSENT && wildcard.fNamespaceList[0] != ABSENT)     return null;
    XSWildcardDecl other=this;
    if (fNamespaceList[0] == ABSENT)     other=wildcard;
    intersectWildcard.fType=other.fType;
    intersectWildcard.fNamespaceList=other.fNamespaceList;
  }
  return intersectWildcard;
}

public XSWildcardDecl performIntersectionWith ( XSWildcardDecl wildcard , short processContents ) { if ( wildcard == null ) return null ; XSWildcardDecl intersectWildcard = new XSWildcardDecl ( ) ; intersectWildcard . fProcessContents = processContents ; if ( areSame ( wildcard ) ) { intersectWildcard . fType = fType ; intersectWildcard . fNamespaceList = fNamespaceList ; } else if ( ( fType == NSCONSTRAINT_ANY ) || ( wildcard . fType == NSCONSTRAINT_ANY ) ) { XSWildcardDecl other = this ; if ( fType == NSCONSTRAINT_ANY ) other = wildcard ; intersectWildcard . fType = other . fType ; intersectWildcard . fNamespaceList = other . fNamespaceList ; } else if ( ( ( fType == NSCONSTRAINT_NOT ) && ( wildcard . fType == NSCONSTRAINT_LIST ) ) || ( ( fType == NSCONSTRAINT_LIST ) && ( wildcard . fType == NSCONSTRAINT_NOT ) ) ) { String [ ] list = null ; String [ ] other = null ; if ( fType == NSCONSTRAINT_NOT ) { other = fNamespaceList ; list = wildcard . fNamespaceList ; } else { other = wildcard . fNamespaceList ; list = fNamespaceList ; } int listSize = list . length ; String [ ] intersect = new String [ listSize ] ; int newSize = 0 ; for ( int i = 0 ; i < listSize ; i ++ ) { if ( list [ i ] != other [ 0 ] && list [ i ] != ABSENT ) intersect [ newSize ++ ] = list [ i ] ; } intersectWildcard . fType = NSCONSTRAINT_LIST ; intersectWildcard . fNamespaceList = new String [ newSize ] ; System . arraycopy ( intersect , 0 , intersectWildcard . fNamespaceList , 0 , newSize ) ; } else if ( ( fType == NSCONSTRAINT_LIST ) && ( wildcard . fType == NSCONSTRAINT_LIST ) ) { intersectWildcard . fType = NSCONSTRAINT_LIST ; intersectWildcard . fNamespaceList = intersect2sets ( fNamespaceList , wildcard . fNamespaceList ) ; } else if ( fType == NSCONSTRAINT_NOT && wildcard . fType == NSCONSTRAINT_NOT ) { if ( fNamespaceList [ 0 ] != ABSENT && wildcard . fNamespaceList [ 0 ] != ABSENT ) return null ; XSWildcardDecl other = this ; if ( fNamespaceList [ 0 ] == ABSENT ) other = wildcard ; intersectWildcard . fType = other . fType ; intersectWildcard . fNamespaceList = other . fNamespaceList ; } return intersectWildcard ; }
schema component constraint : attribute wildcard intersection
