//# 0 errors, 64 messages
//#
/*
    //#ChannelListModeItem.java:1:1: class: com.dmdirc.parser.irc.ChannelListModeItem
    //#ChannelListModeItem.java:1:1: method: com.dmdirc.parser.irc.ChannelListModeItem.com.dmdirc.parser.irc.ChannelListModeItem__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 Channel List Mode information.
 * 
 * @author Shane Mc Cormack
 * @author Chris Smith
 * @see IRCParser
 */
public final class ChannelListModeItem {

	/** The Item itself. */
	private final String myItem;
	
	/** The Time the item was created. */
	private final long myTime;
	
	/** The Person who created the item. */
	private final String myOwner;
	
	/**
	 * Create a new Item.
	 *
	 * @param item The item (ie: test!joe@user.com)
	 * @param owner The owner (ie: Dataforce)
	 * @param time The Time (ie: 1173389295)
	 */
	public ChannelListModeItem(final String item, final String owner, final long time) {
    //#ChannelListModeItem.java:50: method: void com.dmdirc.parser.irc.ChannelListModeItem.com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)
    //#input(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): item
    //#input(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): owner
    //#input(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): owner._tainted
    //#input(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this
    //#input(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): time
    //#output(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): java.lang.String:substring(...)._tainted
    //#output(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myItem
    //#output(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myOwner
    //#output(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myTime
    //#new obj(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): java.lang.String:substring(...)
    //#pre[2] (void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): owner != null
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): init'ed(java.lang.String:substring(...)._tainted)
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myItem == item
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): init'ed(this.myItem)
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myOwner == One-of{&java.lang.String:substring(...), owner}
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myOwner != null
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): this.myTime == time
    //#post(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): init'ed(this.myTime)
    //#test_vector(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): java.lang.String:charAt(...)@54: {0..57, 59..65_535}, {58}
    //#test_vector(void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)): java.lang.String:isEmpty(...)@54: {1}, {0}
		myItem = item;
		myTime = time;

		if (!owner.isEmpty() && owner.charAt(0) == ':') {
			myOwner = owner.substring(1);
		} else {
			myOwner = owner;
		}
	}
    //#ChannelListModeItem.java:59: end of method: void com.dmdirc.parser.irc.ChannelListModeItem.com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)
	
	/**
	 * Get The Item itself.
	 *
	 * @return The Item itself.
	 */
	public String getItem() { return myItem; }
    //#ChannelListModeItem.java:66: method: String com.dmdirc.parser.irc.ChannelListModeItem.getItem()
    //#input(String getItem()): this
    //#input(String getItem()): this.myItem
    //#output(String getItem()): return_value
    //#post(String getItem()): return_value == this.myItem
    //#post(String getItem()): init'ed(return_value)
    //#ChannelListModeItem.java:66: end of method: String com.dmdirc.parser.irc.ChannelListModeItem.getItem()
	
	/**
	 * Get The Person who created the item.
	 *
	 * @return The Person who created the item.
	 */
	public String getOwner() { return myOwner; }
    //#ChannelListModeItem.java:73: method: String com.dmdirc.parser.irc.ChannelListModeItem.getOwner()
    //#input(String getOwner()): this
    //#input(String getOwner()): this.myOwner
    //#output(String getOwner()): return_value
    //#post(String getOwner()): return_value == this.myOwner
    //#post(String getOwner()): init'ed(return_value)
    //#ChannelListModeItem.java:73: end of method: String com.dmdirc.parser.irc.ChannelListModeItem.getOwner()
	
	/**
	 * Get The Time the item was created.
	 *
	 * @return The Time the item was created.
	 */
	public long getTime() { return myTime; }
    //#ChannelListModeItem.java:80: method: long com.dmdirc.parser.irc.ChannelListModeItem.getTime()
    //#input(long getTime()): this
    //#input(long getTime()): this.myTime
    //#output(long getTime()): return_value
    //#post(long getTime()): return_value == this.myTime
    //#post(long getTime()): init'ed(return_value)
    //#ChannelListModeItem.java:80: end of method: long com.dmdirc.parser.irc.ChannelListModeItem.getTime()
	
	/**
	* Returns a String representation of this object.
	*
	* @return String representation of this object
	*/
	@Override
	public String toString() {
		return getItem();
    //#ChannelListModeItem.java:89: method: String com.dmdirc.parser.irc.ChannelListModeItem.toString()
    //#input(String toString()): this
    //#input(String toString()): this.myItem
    //#output(String toString()): return_value
    //#post(String toString()): return_value == this.myItem
    //#post(String toString()): init'ed(return_value)
    //#ChannelListModeItem.java:89: end of method: String com.dmdirc.parser.irc.ChannelListModeItem.toString()
	}

}

    //#output(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Descendant_Table[com/dmdirc/parser/irc/ChannelListModeItem]
    //#output(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getItem()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getOwner()Ljava/lang/String;
    //#output(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getTime()J
    //#output(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.toString()Ljava/lang/String;
    //#post(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Descendant_Table[com/dmdirc/parser/irc/ChannelListModeItem] == &__Dispatch_Table
    //#post(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getItem()Ljava/lang/String; == &getItem
    //#post(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getOwner()Ljava/lang/String; == &getOwner
    //#post(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.getTime()J == &getTime
    //#post(com.dmdirc.parser.irc.ChannelListModeItem__static_init): __Dispatch_Table.toString()Ljava/lang/String; == &toString
    //#ChannelListModeItem.java:: end of method: com.dmdirc.parser.irc.ChannelListModeItem.com.dmdirc.parser.irc.ChannelListModeItem__static_init
    //#ChannelListModeItem.java:: end of class: com.dmdirc.parser.irc.ChannelListModeItem
