//# 0 errors, 125 messages
//#
/*
    //#MyInfo.java:1:1: class: com.dmdirc.parser.irc.MyInfo
    //#MyInfo.java:1:1: method: com.dmdirc.parser.irc.MyInfo.com.dmdirc.parser.irc.MyInfo__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * 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.parser.irc;

/**
 * Contains User information.
 * 
 * @author Shane Mc Cormack
 * @author Chris Smith
 * @see IRCParser
 */
public final class MyInfo {
	/** Character to prepend to nickname if in use (Default "_"). */
	private char prependChar = '_';	
	/** Nickname to attempt to use on IRC. */
	private String nickname;
	/**
	 * Alternative nickname to attempt to use on IRC.
	 * If the first nickname is in use, and a NickInUse message is recieved before 001, we
	 * will attempt to use this nickname instead.<br>
	 * If this also fails, we will start prepending the prependChar character (_) to the main nickname
	 */
	private String altNickname;
	/** Realname string to use */
	private String realname;
	/** Username to use, this doesn't matter when an ident server is running*/
	private String username;
	
	/**
	 * Create a new MyInfo object.
	 */
	public MyInfo() {
    //#MyInfo.java:52: method: void com.dmdirc.parser.irc.MyInfo.com.dmdirc.parser.irc.MyInfo()
    //#input(void com.dmdirc.parser.irc.MyInfo()): " - DMDIrc"._tainted
    //#input(void com.dmdirc.parser.irc.MyInfo()): "-"._tainted
    //#input(void com.dmdirc.parser.irc.MyInfo()): "IRCParser"._tainted
    //#input(void com.dmdirc.parser.irc.MyInfo()): this
    //#output(void com.dmdirc.parser.irc.MyInfo()): java.lang.StringBuilder:toString(...)._tainted
    //#output(void com.dmdirc.parser.irc.MyInfo()): this.altNickname
    //#output(void com.dmdirc.parser.irc.MyInfo()): this.nickname
    //#output(void com.dmdirc.parser.irc.MyInfo()): this.prependChar
    //#output(void com.dmdirc.parser.irc.MyInfo()): this.realname
    //#output(void com.dmdirc.parser.irc.MyInfo()): this.username
    //#new obj(void com.dmdirc.parser.irc.MyInfo()): java.lang.StringBuilder:toString(...)
    //#post(void com.dmdirc.parser.irc.MyInfo()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(void com.dmdirc.parser.irc.MyInfo()): this.altNickname in Addr_Set{&java.lang.StringBuilder:toString(...),&"IRC-Parser"}
    //#post(void com.dmdirc.parser.irc.MyInfo()): this.nickname != null
    //#post(void com.dmdirc.parser.irc.MyInfo()): this.prependChar == 95
    //#post(void com.dmdirc.parser.irc.MyInfo()): this.realname in Addr_Set{&java.lang.StringBuilder:toString(...),&"DMDIrc IRCParser"}
    //#post(void com.dmdirc.parser.irc.MyInfo()): this.username != null
    //#test_vector(void com.dmdirc.parser.irc.MyInfo()): java.lang.String:isEmpty(...)@59: {0}, {1}
		String result;
		try {
			result = System.getProperty("user.name");
		} catch (SecurityException e) {
			result = null;
		}
		if (result == null || result.isEmpty()) {
			nickname = "IRCParser";
			username = "IRCParser";
			realname = "DMDIrc IRCParser";
			altNickname = "IRC-Parser";
		} else {
			nickname = result;
			username = nickname;
			realname = nickname+" - DMDIrc";
			altNickname = nickname+"-";
		}
	}
    //#MyInfo.java:70: end of method: void com.dmdirc.parser.irc.MyInfo.com.dmdirc.parser.irc.MyInfo()
	
	/**
	 * Set the Nickname.
	 *
	 * @param newValue Value to set to.
	 */
	public void setNickname(final String newValue) {
		if (newValue != null && !newValue.isEmpty()) {
    //#MyInfo.java:78: method: void com.dmdirc.parser.irc.MyInfo.setNickname(String)
    //#input(void setNickname(String)): newValue
    //#input(void setNickname(String)): this
    //#output(void setNickname(String)): this.nickname
    //#post(void setNickname(String)): this.nickname == One-of{old this.nickname, newValue}
    //#test_vector(void setNickname(String)): newValue: Addr_Set{null}, Inverse{null}
    //#test_vector(void setNickname(String)): java.lang.String:isEmpty(...)@78: {1}, {0}
			nickname = newValue;
		}
	}
    //#MyInfo.java:81: end of method: void com.dmdirc.parser.irc.MyInfo.setNickname(String)
	
	/**
	 * Get the Nickname.
	 *
	 * @return Current Nickname
	 */
	public String getNickname() { return nickname; }
    //#MyInfo.java:88: method: String com.dmdirc.parser.irc.MyInfo.getNickname()
    //#input(String getNickname()): this
    //#input(String getNickname()): this.nickname
    //#output(String getNickname()): return_value
    //#pre[2] (String getNickname()): init'ed(this.nickname)
    //#post(String getNickname()): return_value == this.nickname
    //#post(String getNickname()): init'ed(return_value)
    //#MyInfo.java:88: end of method: String com.dmdirc.parser.irc.MyInfo.getNickname()
	
	/**
	 * Set the Alternative Nickname.
	 *
	 * @param newValue Value to set to.
	 */
	public void setAltNickname(final String newValue) {
		if (newValue != null && !newValue.isEmpty()) {
    //#MyInfo.java:96: method: void com.dmdirc.parser.irc.MyInfo.setAltNickname(String)
    //#input(void setAltNickname(String)): newValue
    //#input(void setAltNickname(String)): this
    //#output(void setAltNickname(String)): this.altNickname
    //#post(void setAltNickname(String)): this.altNickname == One-of{old this.altNickname, newValue}
    //#test_vector(void setAltNickname(String)): newValue: Addr_Set{null}, Inverse{null}
    //#test_vector(void setAltNickname(String)): java.lang.String:isEmpty(...)@96: {1}, {0}
			altNickname = newValue;
		}
	}
    //#MyInfo.java:99: end of method: void com.dmdirc.parser.irc.MyInfo.setAltNickname(String)
	
	/**
	 * Get the Alternative Nickname.
	 *
	 * @return Current Nickname
	 */
	public String getAltNickname() { return altNickname; }
    //#MyInfo.java:106: method: String com.dmdirc.parser.irc.MyInfo.getAltNickname()
    //#input(String getAltNickname()): this
    //#input(String getAltNickname()): this.altNickname
    //#output(String getAltNickname()): return_value
    //#pre[2] (String getAltNickname()): init'ed(this.altNickname)
    //#post(String getAltNickname()): return_value == this.altNickname
    //#post(String getAltNickname()): init'ed(return_value)
    //#MyInfo.java:106: end of method: String com.dmdirc.parser.irc.MyInfo.getAltNickname()
	
	/**
	 * Set the Realname.
	 *
	 * @param newValue Value to set to.
	 */
	public void setRealname(final String newValue) {
		if (newValue != null && !newValue.isEmpty()) {
    //#MyInfo.java:114: method: void com.dmdirc.parser.irc.MyInfo.setRealname(String)
    //#input(void setRealname(String)): newValue
    //#input(void setRealname(String)): this
    //#output(void setRealname(String)): this.realname
    //#post(void setRealname(String)): this.realname == One-of{old this.realname, newValue}
    //#test_vector(void setRealname(String)): newValue: Addr_Set{null}, Inverse{null}
    //#test_vector(void setRealname(String)): java.lang.String:isEmpty(...)@114: {1}, {0}
			realname = newValue;
		}
	}
    //#MyInfo.java:117: end of method: void com.dmdirc.parser.irc.MyInfo.setRealname(String)
	
	/**
	 * Get the Realname.
	 *
	 * @return Current Realname
	 */
	public String getRealname() { return realname; }
    //#MyInfo.java:124: method: String com.dmdirc.parser.irc.MyInfo.getRealname()
    //#input(String getRealname()): this
    //#input(String getRealname()): this.realname
    //#output(String getRealname()): return_value
    //#pre[2] (String getRealname()): init'ed(this.realname)
    //#post(String getRealname()): return_value == this.realname
    //#post(String getRealname()): init'ed(return_value)
    //#MyInfo.java:124: end of method: String com.dmdirc.parser.irc.MyInfo.getRealname()
	
	/**
	 * Set the Username.
	 *
	 * @param newValue Value to set to.
	 */
	public void setUsername(final String newValue) {
		if (newValue != null && !newValue.isEmpty()) {
    //#MyInfo.java:132: method: void com.dmdirc.parser.irc.MyInfo.setUsername(String)
    //#input(void setUsername(String)): newValue
    //#input(void setUsername(String)): this
    //#output(void setUsername(String)): this.username
    //#post(void setUsername(String)): this.username == One-of{old this.username, newValue}
    //#test_vector(void setUsername(String)): newValue: Addr_Set{null}, Inverse{null}
    //#test_vector(void setUsername(String)): java.lang.String:isEmpty(...)@132: {1}, {0}
			username = newValue;
		}
	}
    //#MyInfo.java:135: end of method: void com.dmdirc.parser.irc.MyInfo.setUsername(String)
	
	/**
	 * Get the Username.
	 *
	 * @return Current Username
	 */
	public String getUsername() { return username; }
    //#MyInfo.java:142: method: String com.dmdirc.parser.irc.MyInfo.getUsername()
    //#input(String getUsername()): this
    //#input(String getUsername()): this.username
    //#output(String getUsername()): return_value
    //#pre[2] (String getUsername()): init'ed(this.username)
    //#post(String getUsername()): return_value == this.username
    //#post(String getUsername()): init'ed(return_value)
    //#MyInfo.java:142: end of method: String com.dmdirc.parser.irc.MyInfo.getUsername()
	
	/**
	 * Set the Prepend Character.
	 *
	 * @param newValue Value to set to.
	 */
	public void setPrependChar(final char newValue) { prependChar = newValue; }
    //#MyInfo.java:149: method: void com.dmdirc.parser.irc.MyInfo.setPrependChar(char)
    //#input(void setPrependChar(char)): newValue
    //#input(void setPrependChar(char)): this
    //#output(void setPrependChar(char)): this.prependChar
    //#post(void setPrependChar(char)): this.prependChar == newValue
    //#post(void setPrependChar(char)): init'ed(this.prependChar)
    //#MyInfo.java:149: end of method: void com.dmdirc.parser.irc.MyInfo.setPrependChar(char)
	
	/**
	 * Get the Prepend Character.
	 *
	 * @return Current Prepend Character
	 */
	public char getPrependChar() { return prependChar; }	
    //#MyInfo.java:156: method: char com.dmdirc.parser.irc.MyInfo.getPrependChar()
    //#input(char getPrependChar()): this
    //#input(char getPrependChar()): this.prependChar
    //#output(char getPrependChar()): return_value
    //#pre[2] (char getPrependChar()): init'ed(this.prependChar)
    //#post(char getPrependChar()): return_value == this.prependChar
    //#post(char getPrependChar()): init'ed(return_value)
    //#MyInfo.java:156: end of method: char com.dmdirc.parser.irc.MyInfo.getPrependChar()

}
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Descendant_Table[com/dmdirc/parser/irc/MyInfo]
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getAltNickname()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getNickname()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getPrependChar()C
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getRealname()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getUsername()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setAltNickname(Ljava/lang/String;)V
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setNickname(Ljava/lang/String;)V
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setPrependChar(C)V
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setRealname(Ljava/lang/String;)V
    //#output(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setUsername(Ljava/lang/String;)V
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Descendant_Table[com/dmdirc/parser/irc/MyInfo] == &__Dispatch_Table
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getAltNickname()Ljava/lang/String; == &getAltNickname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getNickname()Ljava/lang/String; == &getNickname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getPrependChar()C == &getPrependChar
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getRealname()Ljava/lang/String; == &getRealname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.getUsername()Ljava/lang/String; == &getUsername
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setAltNickname(Ljava/lang/String;)V == &setAltNickname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setNickname(Ljava/lang/String;)V == &setNickname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setPrependChar(C)V == &setPrependChar
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setRealname(Ljava/lang/String;)V == &setRealname
    //#post(com.dmdirc.parser.irc.MyInfo__static_init): __Dispatch_Table.setUsername(Ljava/lang/String;)V == &setUsername
    //#MyInfo.java:: end of method: com.dmdirc.parser.irc.MyInfo.com.dmdirc.parser.irc.MyInfo__static_init
    //#MyInfo.java:: end of class: com.dmdirc.parser.irc.MyInfo
