/** * Returns a metadata attribute wich is the representation of the flag with the given name. This method delegates to * getPropertyValue(String). * * @param name the flag name * @return a metadata attribute wich is the representation of the flag with the given name */ public MetadataAttribute getFlag(String name) { return getAttribute(name); }
/** * Returns the flag mask value for the specified flag name. * * @param name the flag name * @return flagMask the flag's bit mask as a 32 bit integer * @throws IllegalArgumentException if <code>name</code> is null, or a flag with the name does not exist */ public int getFlagMask(String name) { Guardian.assertNotNull("name", name); MetadataAttribute attribute = getAttribute(name); if (attribute == null) { throw new IllegalArgumentException("flag '" + name + "' not found"); } Debug.assertTrue(attribute.getData().isInt()); Debug.assertTrue(attribute.getData().isScalar()); return attribute.getData().getElemInt(); }
private String getSuitableBitmaskDefDescription(Term.Ref ref) { String description = null; final String symbolName = ref.getSymbol().getName(); if (isFlagSymbol(symbolName)) { final String[] strings = StringUtils.split(symbolName, new char[]{'.'}, true); final String nodeName = strings[0]; final String flagName = strings[1]; final RasterDataNode rasterDataNode = getRasterDataNode(nodeName); if (rasterDataNode instanceof Band) { final FlagCoding flagCoding = ((Band) rasterDataNode).getFlagCoding(); if (flagCoding != null) { final MetadataAttribute attribute = flagCoding.getAttribute(flagName); if (attribute != null) { description = attribute.getDescription(); } } } } else { final RasterDataNode rasterDataNode = getRasterDataNode(symbolName); if (rasterDataNode != null) { description = rasterDataNode.getDescription(); } } return description; }
assertNotSame(sourceChild.getAttribute("a"), targetChild.getAttribute("a")); assertNotSame(sourceChild.getAttribute("b"), targetChild.getAttribute("b")); assertNotSame(sourceChild.getAttribute("a").getData(), targetChild.getAttribute("a").getData()); assertNotSame(sourceChild.getAttribute("b").getData(), targetChild.getAttribute("b").getData());