/** * Gets the index of the given attribute. * * @param attribute The attribute. * * @return The attribute's index, or -1. * * @since BEAM 4.7 */ public int getAttributeIndex(MetadataAttribute attribute) { return attributes.indexOf(attribute); }
/** * Gets the index of the given element. * * @param element The element . * * @return The element's index, or -1. * * @since BEAM 4.7 */ public int getElementIndex(MetadataElement element) { return elements.indexOf(element); }
/** * Returns the index for the band with the given name. * * @param name the band name * * @return the band index or <code>-1</code> if a band with the given name is not contained in this product. * * @throws IllegalArgumentException if the given name is <code>null</code> or empty. */ public int getBandIndex(final String name) { Guardian.assertNotNullOrEmpty("name", name); return bandGroup.indexOf(name); }
int getMaskIndex(String name) { return getMaskGroup().indexOf(name); }
@Override protected int getIndex(AbstractTN child) { if (productNode instanceof ProductNodeGroup) { ProductNodeGroup nodeGroup = (ProductNodeGroup) productNode; ProductNodeTN childNodeTN = (ProductNodeTN) child; return nodeGroup.indexOf(childNodeTN.getProductNode().getName()); } throw new IndexOutOfBoundsException("node has no children"); } }
int bandIndex = bandGroup.indexOf(computedBand); bandGroup.remove(computedBand); bandGroup.add(bandIndex, realBand);