/** * Gets the attributeType at this xPath, if the specified attributeType * does not exist then null is returned. * * @param xPath XPath pointer to attribute type. * * @return True if attribute exists. */ public AttributeType getAttributeType(String xPath) { AttributeType attType = null; int idx = find(xPath); if (idx >= 0) { attType = children[idx]; } return attType; }
/** * Gets the attributeType at this xPath, if the specified attributeType * does not exist then null is returned. * * @param xPath XPath pointer to attribute type. * * @return True if attribute exists. */ public AttributeType getAttributeType(String xPath) { AttributeType attType = null; int idx = find(xPath); if (idx >= 0) { attType = children[idx]; } return attType; }
/** * Find the position of a given AttributeType. * * @param type The type to search for. * * @return -1 if not found, a zero-based index if found. */ public int find(AttributeType type) { if (type == null) { return -1; } int idx = find(type.getName()); if ((idx < 0) || !children[idx].equals(type)) { idx = -1; } return idx; }
/** * Find the position of a given AttributeType. * * @param type The type to search for. * * @return -1 if not found, a zero-based index if found. */ public int find(AttributeType type) { if (type == null) { return -1; } int idx = find(type.getLocalName()); if ((idx < 0) || !children[idx].equals(type)) { idx = -1; } return idx; }