stateRequired = new BitSet(list.size());
for (int i = 0; i < list.size(); i++) {
Object stylerObject = list.get(i);
if (stylerObject instanceof IndexableStyler) {
IndexableStyler styler = (IndexableStyler) stylerObject;
String element = styler.getMatchableElement();
if (element != null) {
BitSet elementMatches =
(BitSet) elementsIndex.get(element);
if (elementMatches == null) {
elementMatches = new BitSet(list.size());
elementsIndex.put(element, elementMatches);
}
elementMatches.set(i);
}
String[] classesMatch = styler.getMatchableClasses();
if (classesMatch != null) {
for (int j = 0; j < classesMatch.length; j++) {
BitSet classMatches =
(BitSet) classesIndex.get(classesMatch[j]);
if (classMatches == null) {
classMatches = new BitSet(list.size());
classesIndex.put(classesMatch[j], classMatches);
}
classMatches.set(i);
}
}
if (styler.isMatchAny()) {
matchAll.set(i);
}
SelectionState state =
styler.getRequiredSelectionState();
if (state != null) {
BitSet stateMatches =
(BitSet) statesIndex.get(state);
if (stateMatches == null) {
stateMatches = new BitSet(list.size());