@Override public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (Repeater r : repeaters) r.assignDefaults(properties, values); }
@Override protected boolean variant(int variant, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // iteration is not modified in this function int i = iteration.get(); Term<?> term = terms.get(i); Repeater r; switch (variant) { case WIDTH: r = repeaters.get(WIDTH); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case STYLE: r = repeaters.get(STYLE); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case COLOR: r = repeaters.get(COLOR); r.assignTerms(term, term, term, term); return r.repeat(properties, values); default: return false; } }
/** * Repeats operations on terms * * @param properties * Properties map where to store properties types * @param values * Values map where to store properties values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ public boolean repeat(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (int i = 0; i < times; i++) { if (!operation(i, properties, values)) return false; } return true; }
@SuppressWarnings("unused") private boolean processMargin(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater margin = new MarginRepeater(); return margin.repeatOverFourTermDeclaration(d, properties, values); }
@SuppressWarnings("unused") private boolean processMargin(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater margin = new MarginRepeater(); return margin.repeatOverFourTermDeclaration(d, properties, values); }
@Override protected boolean variant(int variant, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // iteration is not modified in this function int i = iteration.get(); Term<?> term = terms.get(i); Repeater r; switch (variant) { case WIDTH: r = repeaters.get(WIDTH); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case STYLE: r = repeaters.get(STYLE); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case COLOR: r = repeaters.get(COLOR); r.assignTerms(term, term, term, term); return r.repeat(properties, values); default: return false; } }
@SuppressWarnings("unused") private boolean processPadding(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater padding = new PaddingRepeater(); return padding.repeatOverFourTermDeclaration(d, properties, values); }
@Override public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (Repeater r : repeaters) r.assignDefaults(properties, values); }
/** * Repeats operations on terms * * @param properties * Properties map where to store properties types * @param values * Values map where to store properties values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ public boolean repeat(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (int i = 0; i < times; i++) { if (!operation(i, properties, values)) return false; } return true; }
@Override protected boolean variant(int variant, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // iteration is not modified in this function int i = iteration.get(); Term<?> term = terms.get(i); Repeater r; switch (variant) { case WIDTH: r = repeaters.get(WIDTH); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case STYLE: r = repeaters.get(STYLE); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case COLOR: r = repeaters.get(COLOR); r.assignTerms(term, term, term, term); return r.repeat(properties, values); default: return false; } }
@SuppressWarnings("unused") private boolean processBorderStyle(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater borderStyle = new BorderStyleRepeater(); return borderStyle.repeatOverFourTermDeclaration(d, properties, values); }
@Override public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (Repeater r : repeaters) r.assignDefaults(properties, values); }
/** * Repeats operations on terms * * @param properties * Properties map where to store properties types * @param values * Values map where to store properties values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ public boolean repeat(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (int i = 0; i < times; i++) { if (!operation(i, properties, values)) return false; } return true; }
@Override protected boolean variant(int variant, IntegerRef iteration, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { // iteration is not modified in this function int i = iteration.get(); Term<?> term = terms.get(i); Repeater r; switch (variant) { case WIDTH: r = repeaters.get(WIDTH); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case STYLE: r = repeaters.get(STYLE); r.assignTerms(term, term, term, term); return r.repeat(properties, values); case COLOR: r = repeaters.get(COLOR); r.assignTerms(term, term, term, term); return r.repeat(properties, values); default: return false; } }
@SuppressWarnings("unused") private boolean processBorderStyle(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater borderStyle = new BorderStyleRepeater(); return borderStyle.repeatOverFourTermDeclaration(d, properties, values); }
@Override public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (Repeater r : repeaters) r.assignDefaults(properties, values); }
/** * Repeats operations on terms * * @param properties * Properties map where to store properties types * @param values * Values map where to store properties values * @return <code>true</code> in case of success, <code>false</code> * elsewhere */ public boolean repeat(Map<String, CSSProperty> properties, Map<String, Term<?>> values) { for (int i = 0; i < times; i++) { if (!operation(i, properties, values)) return false; } return true; }
/** * This method is overriden to use repeaters */ @Override protected boolean checkInherit(int variant, Term<?> term, Map<String, CSSProperty> properties) { // check whether term equals inherit if (!(term instanceof TermIdent) || !CSSProperty.INHERIT_KEYWORD .equalsIgnoreCase(((TermIdent) term).getValue())) { return false; } if (variant == ALL_VARIANTS) { for (int i = 0; i < variants; i++) { Repeater r = repeaters.get(i); r.assignTerms(term, term, term, term); r.repeat(properties, null); } return true; } Repeater r = repeaters.get(variant); r.assignTerms(term, term, term, term); r.repeat(properties, null); return true; }
@SuppressWarnings("unused") private boolean processBorderStyle(Declaration d, Map<String, CSSProperty> properties, Map<String, Term<?>> values) { Repeater borderStyle = new BorderStyleRepeater(); return borderStyle.repeatOverFourTermDeclaration(d, properties, values); }
/** * This method is overriden to use repeaters */ @Override protected boolean checkInherit(int variant, Term<?> term, Map<String, CSSProperty> properties) { // check whether term equals inherit if (!(term instanceof TermIdent) || !CSSProperty.INHERIT_KEYWORD .equalsIgnoreCase(((TermIdent) term).getValue())) { return false; } if (variant == ALL_VARIANTS) { for (int i = 0; i < variants; i++) { Repeater r = repeaters.get(i); r.assignTerms(term, term, term, term); r.repeat(properties, null); } return true; } Repeater r = repeaters.get(variant); r.assignTerms(term, term, term, term); r.repeat(properties, null); return true; }