public boolean equals(Object obj) {
if(!(obj instanceof XQItemType)) {
return false;
}
// getItemKind() is equal
XQItemType objtype = (XQItemType) obj;
int kind = getItemKind(), thatkind = objtype.getItemKind();
if(kind != thatkind) {
return false;
}
// if getBaseType() is supported for the item kind, it must be equal
try {
final int basetype = getBaseType(), thatBaseType = objtype.getBaseType();
if(basetype != thatBaseType) {
return false;
}
} catch (XQException e) {
}
// if getNodeName() is supported for the item kind, it must be equal
try {
final QName nodeName = getNodeName(), thatNodeName = objtype.getNodeName();
if(nodeName == null) {
if(thatNodeName != null) {
return false;
}
} else if(!nodeName.equals(thatNodeName)) {
return false;
}
} catch (XQException e) {
}
// getSchemaURI() is equal
final URI uri = getSchemaURI(), thatUri = objtype.getSchemaURI();
if(uri == null) {
if(thatUri != null) {
return false;
}
} else if(!uri.equals(thatUri)) {
return false;
}
// if getTypeName() is supported for the item kind, it must be equal
try {
final QName typeName = getTypeName(), thatTypeName = objtype.getTypeName();
if(typeName == null) {
if(thatTypeName != null) {
return false;
}
} else if(!typeName.equals(thatTypeName)) {
return false;
}
} catch (XQException e) {
}
// isAnonymousType() is equal
final boolean isAnon = isAnonymousType(), thatIsAnon = objtype.isAnonymousType();
if(isAnon != thatIsAnon) {
return false;
}
// isElementNillable() is equal
final boolean isNillable = isElementNillable(), thatIsNillable = objtype.isElementNillable();
if(isNillable != thatIsNillable) {
return false;
}
// if getPIName() is supported for the item kind, it must be equal
try {
final String pi = getPIName(), thatPi = objtype.getPIName();
if(pi == null) {
if(thatPi != null) {
return false;
}
} else if(!pi.equals(thatPi)) {