/** * 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) {return featureType.find(type); }
/** * Find the position of an AttributeType which matches the given String. * @param attName the name to look for * @return -1 if not found, zero-based index otherwise */ public int find(String attName) { return featureType.find(attName); }
/** * Find the position of an AttributeType which matches the given String. * @param attName the name to look for * @return -1 if not found, zero-based index otherwise */ public int find(String attName) { return featureType.find(attName); }
/** * 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) {return featureType.find(type); }
/** * Sets the attribute at the given xPath. Note that right now this * just does the name, and will fail on anything other than the name. * * @param xPath The name of the attribute to Set. * @param attribute The value to set - must be a List, for this Complex * Feature. * * @throws IllegalAttributeException DOCUMENT ME! * * @task TODO: Revisit xPath stuff - get it working or do external * implementation. */ public void setAttribute(String xPath, Object attribute) throws IllegalAttributeException { int idx = super.getFeatureType().find(xPath); if (idx < 0) { throw new IllegalAttributeException("No attribute named " + xPath); } setAttribute(idx, attribute); }
/** * Sets the attribute at the given xPath. Note that right now this * just does the name, and will fail on anything other than the name. * * @param xPath The name of the attribute to Set. * @param attribute The value to set - must be a List, for this Complex * Feature. * * @throws IllegalAttributeException DOCUMENT ME! * * @task TODO: Revisit xPath stuff - get it working or do external * implementation. */ public void setAttribute(String xPath, Object attribute) { int idx = super.getFeatureType().find(xPath); if (idx < 0) { throw new IllegalAttributeException("No attribute named " + xPath); } setAttribute(idx, attribute); } /**
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if (test instanceof NodeNameTest) { NodeNameTest nodeNameTest = (NodeNameTest) test; if (!nodeNameTest.isWildcard()) { int index = featureType.find(nodeNameTest.getNodeName().getName()); if (index > -1) { return new SingleFeatureTypeAttributeIterator(this, index); } } else { return new FeatureTypeAttributeIterator(this); } } if (test instanceof NodeTypeTest) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE) { return new FeatureTypeAttributeIterator(this); } } return super.childIterator(test, reverse, startWith); } }
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if ( test instanceof NodeNameTest ) { NodeNameTest nodeNameTest = (NodeNameTest) test; if ( !nodeNameTest.isWildcard() ) { int index = featureType.find( nodeNameTest.getNodeName().getName() ); if ( index > -1 ) { return new SingleFeatureTypeAttributeIterator( this, index ); } } else { return new FeatureTypeAttributeIterator( this ); } } if ( test instanceof NodeTypeTest ) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if ( nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE ) { return new FeatureTypeAttributeIterator( this ); } } return super.childIterator( test, reverse, startWith ); }
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if (test instanceof NodeNameTest) { NodeNameTest nodeNameTest = (NodeNameTest) test; if (!nodeNameTest.isWildcard()) { int index = feature.getFeatureType().find(nodeNameTest.getNodeName().getName()); if (index > -1) { return new SingleFeaturePropertyIterator(this, index); } } else { return new FeaturePropertyIterator(this); } } if (test instanceof NodeTypeTest) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE) { return new FeaturePropertyIterator(this); } } return super.childIterator(test, reverse, startWith); }
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if ( test instanceof NodeNameTest ) { NodeNameTest nodeNameTest = (NodeNameTest) test; if ( !nodeNameTest.isWildcard() ) { int index = feature.getFeatureType().find( nodeNameTest.getNodeName().getName() ); if ( index > -1 ) { return new SingleFeaturePropertyIterator( this, index ); } } else { return new FeaturePropertyIterator( this ); } } if ( test instanceof NodeTypeTest ) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if ( nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE ) { return new FeaturePropertyIterator( this ); } } return super.childIterator( test, reverse, startWith ); }