//# 0 errors, 72 messages
//#
/*
    //#CLIParam.java:1:1: class: com.dmdirc.installer.cliparser.CLIParam
    //#CLIParam.java:1:1: method: com.dmdirc.installer.cliparser.CLIParam.com.dmdirc.installer.cliparser.CLIParam__static_init
 * Copyright (c) 2006-2009 Shane Mc Cormack
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.installer.cliparser;

/**
 * Command Line argument type.
 */
public abstract class CLIParam {
	/** Single Character flag for this param. */
	private final char charFlag;
	/** String flag for this param. */
	private final String stringFlag;
	/** Description of this flag. */
	private final String description;
	/** Number of times this param has been given. */
	private int number;
	
	/**
	 * Create a new CLIParam.
	 *
	 * @param chr Single Character flag for this param.
	 * @param str String flag for this param.
	 * @param desc Description of this flag.
	 */
	protected CLIParam(final char chr, final String str, final String desc) {
    //#CLIParam.java:45: method: void com.dmdirc.installer.cliparser.CLIParam.com.dmdirc.installer.cliparser.CLIParam(char, String, String)
    //#input(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): chr
    //#input(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): desc
    //#input(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): str
    //#input(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this
    //#output(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.charFlag
    //#output(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.description
    //#output(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.stringFlag
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.charFlag == chr
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): init'ed(this.charFlag)
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.description == desc
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): init'ed(this.description)
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): this.stringFlag == str
    //#post(void com.dmdirc.installer.cliparser.CLIParam(char, String, String)): init'ed(this.stringFlag)
		charFlag = chr;
		stringFlag = str;
		description = desc;
	}
    //#CLIParam.java:49: end of method: void com.dmdirc.installer.cliparser.CLIParam.com.dmdirc.installer.cliparser.CLIParam(char, String, String)
	
	/**
	 * Get the single character flag for this param.
	 */
	public final char getChr() { return charFlag; }
    //#CLIParam.java:54: method: char com.dmdirc.installer.cliparser.CLIParam.getChr()
    //#input(char getChr()): this
    //#input(char getChr()): this.charFlag
    //#output(char getChr()): return_value
    //#post(char getChr()): return_value == this.charFlag
    //#post(char getChr()): init'ed(return_value)
    //#CLIParam.java:54: end of method: char com.dmdirc.installer.cliparser.CLIParam.getChr()
	
	/**
	 * Get the string flag for this param.
	 */
	public final String getString() { return stringFlag; }
    //#CLIParam.java:59: method: String com.dmdirc.installer.cliparser.CLIParam.getString()
    //#input(String getString()): this
    //#input(String getString()): this.stringFlag
    //#output(String getString()): return_value
    //#post(String getString()): return_value == this.stringFlag
    //#post(String getString()): init'ed(return_value)
    //#CLIParam.java:59: end of method: String com.dmdirc.installer.cliparser.CLIParam.getString()
	
	/**
	 * Get the description for this param.
	 */
	public final String getDescription() { return description; }
    //#CLIParam.java:64: method: String com.dmdirc.installer.cliparser.CLIParam.getDescription()
    //#input(String getDescription()): this
    //#input(String getDescription()): this.description
    //#output(String getDescription()): return_value
    //#post(String getDescription()): return_value == this.description
    //#post(String getDescription()): init'ed(return_value)
    //#CLIParam.java:64: end of method: String com.dmdirc.installer.cliparser.CLIParam.getDescription()
	
	/**
	 * Get the number of times this value has been given.
	 */
	public final int getNumber() { return number; }
    //#CLIParam.java:69: method: int com.dmdirc.installer.cliparser.CLIParam.getNumber()
    //#input(int getNumber()): this
    //#input(int getNumber()): this.number
    //#output(int getNumber()): return_value
    //#pre[2] (int getNumber()): init'ed(this.number)
    //#post(int getNumber()): return_value == this.number
    //#post(int getNumber()): init'ed(return_value)
    //#CLIParam.java:69: end of method: int com.dmdirc.installer.cliparser.CLIParam.getNumber()
	
	/**
	 * Increment the number of times this value has been given.
	 */
	public final void incNumber() { ++number; }
    //#CLIParam.java:74: method: void com.dmdirc.installer.cliparser.CLIParam.incNumber()
    //#input(void incNumber()): this
    //#input(void incNumber()): this.number
    //#output(void incNumber()): this.number
    //#pre[1] (void incNumber()): this.number <= 4_294_967_294
    //#post(void incNumber()): this.number == old this.number + 1
    //#post(void incNumber()): this.number >= -2_147_483_647
    //#CLIParam.java:74: end of method: void com.dmdirc.installer.cliparser.CLIParam.incNumber()
	
	/**
	 * Set the value of this param to the value given by a string.
	 *
	 * @param value String taken from command line to use as value.
	 * @return true if value was valid, else false.
	 */
	public abstract boolean setValue(final String value);
	
	/**
	 * Return the value of this param as a string.
	 *
	 * @return The value of this param as a string.
	 */
	public abstract String getStringValue();
}
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Descendant_Table[com/dmdirc/installer/cliparser/CLIParam]
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getChr()C
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getDescription()Ljava/lang/String;
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getNumber()I
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getString()Ljava/lang/String;
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getStringValue()Ljava/lang/String;
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.incNumber()V
    //#output(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.setValue(Ljava/lang/String;)Z
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Descendant_Table[com/dmdirc/installer/cliparser/CLIParam] == &__Dispatch_Table
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getChr()C == &getChr
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getDescription()Ljava/lang/String; == &getDescription
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getNumber()I == &getNumber
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getString()Ljava/lang/String; == &getString
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.getStringValue()Ljava/lang/String; == &getStringValue
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.incNumber()V == &incNumber
    //#post(com.dmdirc.installer.cliparser.CLIParam__static_init): __Dispatch_Table.setValue(Ljava/lang/String;)Z == &setValue
    //#CLIParam.java:: end of method: com.dmdirc.installer.cliparser.CLIParam.com.dmdirc.installer.cliparser.CLIParam__static_init
    //#CLIParam.java:: end of class: com.dmdirc.installer.cliparser.CLIParam
