package org.apache.fop.fo; import java.util.BitSet; public class PropertySets { public static short[][] mapping = null; public static void initialize() { mapping = new short[Constants.ELEMENT_COUNT][]; boolean loop = true; while (loop) { loop = false; } } private static short[] makeSparseIndices(BitSet set) { short[] indices = new short[Constants.PROPERTY_COUNT]; indices[0] = (short) (set.cardinality() + 1); int j = 1; for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i+1)) { indices[i] = (short) j++; } return indices; } private static boolean mergeContent(BitSet node, BitSet content, boolean loop) { int c = node.cardinality(); node.or(content); if (c == node.cardinality()) return loop; return true; } public static short[] getPropertySet(int elementId) { if (mapping == null) initialize(); return mapping[elementId]; } } BitSet = new BitSet(); .set(Constants.PR_ ); fo_ BitSet = new BitSet(); fo_ fo_ loop = mergeContent(, fo_block, loop); loop = mergeContent(, fo_block_container, loop); loop = mergeContent(, fo_table_and_caption, loop); loop = mergeContent(, fo_table, loop); loop = mergeContent(, fo_list_block, loop); loop = mergeContent(, fo_bidi_override, loop); loop = mergeContent(, fo_character, loop); loop = mergeContent(, fo_external_graphic, loop); loop = mergeContent(, fo_instream_foreign_object, loop); loop = mergeContent(, fo_inline, loop); loop = mergeContent(, fo_inline_container, loop); loop = mergeContent(, fo_leader, loop); loop = mergeContent(, fo_page_number, loop); loop = mergeContent(, fo_page_number_citation, loop); loop = mergeContent(, fo_basic_link, loop); loop = mergeContent(, fo_multi_toggle, loop); loop = mergeContent(, , loop); fo_ mapping[Constants. ] = makeSparseIndices(); .or(); .set(Constants.PR_ );