本文整理匯總了Java中cz.vutbr.web.css.CSSProperty.CounterIncrement類的典型用法代碼示例。如果您正苦於以下問題:Java CounterIncrement類的具體用法?Java CounterIncrement怎麽用?Java CounterIncrement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CounterIncrement類屬於cz.vutbr.web.css.CSSProperty包,在下文中一共展示了CounterIncrement類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processCounterIncrement
import cz.vutbr.web.css.CSSProperty.CounterIncrement; //導入依賴的package包/類
@SuppressWarnings("unused")
private boolean processCounterIncrement(Declaration d,
Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
if (d.size() == 1
&& genericOneIdent(CounterIncrement.class, d, properties)) {
return true;
}
// counter with increments
else {
// counters are stored there
Set<Term<?>> termList = new LinkedHashSet<Term<?>>();
String counterName = null;
for (Term<?> term : d.asList()) {
// counter name
if (term instanceof TermIdent) {
counterName = ((TermIdent) term).getValue();
termList.add(tf.createPair(counterName, new Integer(1)));
}
// counter reset value follows counter name
else if (term instanceof TermInteger && counterName != null) {
termList.add(tf.createPair(counterName,
((TermInteger) term).getValue()));
counterName = null;
} else {
return false;
}
}
if (!termList.isEmpty()) {
TermList list = tf.createList(termList.size());
list.addAll(termList);
properties.put("counter-increment",
CounterIncrement.list_values);
values.put("counter-increment", list);
return true;
}
return false;
}
}