本文整理汇总了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;
}
}