/** * Adds a new index definition to this flags coding. * * @param name the index name * @param value the index value * @param description the description text * @throws IllegalArgumentException if <code>name</code> is null * @return A new attribute representing the coded index. */ public MetadataAttribute addIndex(String name, int value, String description) { return addSample(name, value, description); }
private static IndexCoding createIndexCoding(String indexCodingName, int[] flagValues, String[] flagNames) { if (flagValues != null && flagNames != null && flagValues.length == flagNames.length) { final IndexCoding coding = new IndexCoding(indexCodingName); for (int i = 0; i < flagValues.length; i++) { final String sampleName = flagNames[i]; final int sampleValue = flagValues[i]; coding.addSample(sampleName, sampleValue, ""); } if (coding.getNumAttributes() > 0) { return coding; } } return null; } }