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

org.rhq.plugins.apache.parser.ApacheDirectiveStack Maven / Gradle / Ivy

There is a newer version: 4.13.0
Show newest version
package org.rhq.plugins.apache.parser;

import java.util.ArrayList;
import java.util.List;

public class ApacheDirectiveStack {

    protected List stack;
    
    public ApacheDirectiveStack(){
        stack= new ArrayList();
    }
    
    public void addDirective(ApacheDirective dir){
        stack.add(dir);
    }
    
    public ApacheDirective getLastDirective(){
        return stack.get(stack.size()-1);
    }
    
    public void removeLastDirective(){
        stack.remove(stack.size()-1);
    }
    
    public ApacheDirectiveStack copy(){
        ApacheDirectiveStack st = new ApacheDirectiveStack();
        for (ApacheDirective dir : stack){
            st.addDirective(dir);
        }
        
        return st;
    }
    
    public boolean isEmpty(){
        if (stack.size()==0)
            return true;
        else
            return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy