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

kg.apc.cmdtools.AbstractCMDTool Maven / Gradle / Ivy

There is a newer version: 2.3
Show newest version
package kg.apc.cmdtools;

import java.io.PrintStream;
import java.util.ListIterator;

/**
 *
 * @author undera
 */
public abstract class AbstractCMDTool {

    public AbstractCMDTool() {
    }

    protected int getLogicValue(String string) {
        if (string.equalsIgnoreCase("on")) {
            return 1;
        }
        if (string.equalsIgnoreCase("1")) {
            return 1;
        }
        if (string.equalsIgnoreCase("yes")) {
            return 1;
        }
        if (string.equalsIgnoreCase("true")) {
            return 1;
        }
        return 0;
    }

    protected abstract int processParams(ListIterator args) throws UnsupportedOperationException, IllegalArgumentException;

    protected abstract void showHelp(PrintStream os);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy