All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xbib.cql.ModifierList Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.xbib.cql;

import java.util.LinkedList;
import java.util.List;

/**
 * Modifier list. This is a recursive data structure with a Modifier and optionally a ModifierList.
 */
public class ModifierList extends AbstractNode {

    private List modifierList = new LinkedList<>();

    public ModifierList(ModifierList modifiers, Modifier modifier) {
        modifierList.addAll(modifiers.modifierList);
        modifierList.add(modifier);
    }

    public ModifierList(Modifier modifier) {
        modifierList.add(modifier);
    }

    public List getModifierList() {
        return modifierList;
    }

    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        for (Modifier m : modifierList) {
            sb.append(m.toString());
        }
        return sb.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy