head	1.2;
access;
symbols
	bg2_23:1.2
	bg2_22:1.2
	bg2_21:1.2
	bg2_20:1.2
	bg2_16:1.2
	bg2_15:1.2
	bg2_12:1.2
	bg2_07:1.2;
locks; strict;
comment	@# @;


1.2
date	2008.02.17.20.47.28;	author stefant;	state Exp;
branches;
next	1.1;
commitid	6be447b89d5a4567;

1.1
date	2008.01.13.20.43.53;	author stefant;	state Exp;
branches;
next	;
commitid	4e54478a77ec4567;


desc
@@


1.2
log
@initializing all actions with id, fallback for configuration to default name, new syntax for action-options.
@
text
@/*
 * Copyright (c) 2007,2008, Stefan Hepp
 *
 * This file is part of JOPtimizer.
 *
 * JOPtimizer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * JOPtimizer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package joptimizer.config;

import java.io.PrintStream;
import java.util.Properties;

/**
 * A boolean argument option, option is set to TRUE when this argument is given.
 * @@author Stefan Hepp, e0026640@@student.tuwien.ac.at
 */
public class BoolOption extends ArgOption {

    public BoolOption(String prefix, String option, String description) {
        super(prefix, option, description);
    }

    public int parse(String option, String[] args, int pos, Properties props) {
        props.setProperty( getFullName(), "TRUE");
        return 0;
    }

    public void printHelp(String prefix, PrintStream out) {
        out.println( formatOption(prefix, getFullName(), getDescription() ));
    }
}
@


1.1
log
@added joptimizer sources
@
text
@d1 42
a42 42
/*
 * Copyright (c) 2007,2008, Stefan Hepp
 *
 * This file is part of JOPtimizer.
 *
 * JOPtimizer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * JOPtimizer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package joptimizer.config;

import java.io.PrintStream;
import java.util.Properties;

/**
 * A boolean argument option, option is set to TRUE when this argument is given.
 * @@author Stefan Hepp, e0026640@@student.tuwien.ac.at
 */
public class BoolOption extends ArgOption {

    public BoolOption(String name, String description) {
        super(name, description);
    }

    public int parse(String option, String[] args, int pos, Properties props) {
        props.setProperty( getName(), "TRUE");
        return 0;
    }

    public void printHelp(String prefix, PrintStream out) {
        out.println( formatOption(prefix, getName(), getDescription() ));
    }
}
@

