File Source: ChannelListModeItem.java

         /* 
    P/P   *  Method: com.dmdirc.parser.irc.ChannelListModeItem__static_init
          */
     1  /*
     2   * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
     3   *
     4   * Permission is hereby granted, free of charge, to any person obtaining a copy
     5   * of this software and associated documentation files (the "Software"), to deal
     6   * in the Software without restriction, including without limitation the rights
     7   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     8   * copies of the Software, and to permit persons to whom the Software is
     9   * furnished to do so, subject to the following conditions:
    10   *
    11   * The above copyright notice and this permission notice shall be included in
    12   * all copies or substantial portions of the Software.
    13   *
    14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    20   * SOFTWARE.
    21   */
    22  
    23  package com.dmdirc.parser.irc;
    24  
    25  /**
    26   * Contains Channel List Mode information.
    27   * 
    28   * @author Shane Mc Cormack
    29   * @author Chris Smith
    30   * @see IRCParser
    31   */
    32  public final class ChannelListModeItem {
    33  
    34  	/** The Item itself. */
    35  	private final String myItem;
    36  	
    37  	/** The Time the item was created. */
    38  	private final long myTime;
    39  	
    40  	/** The Person who created the item. */
    41  	private final String myOwner;
    42  	
    43  	/**
    44  	 * Create a new Item.
    45  	 *
    46  	 * @param item The item (ie: test!joe@user.com)
    47  	 * @param owner The owner (ie: Dataforce)
    48  	 * @param time The Time (ie: 1173389295)
    49  	 */
        	 /* 
    P/P 	  *  Method: void com.dmdirc.parser.irc.ChannelListModeItem(String, String, long)
        	  * 
        	  *  Preconditions:
        	  *    owner != null
        	  * 
        	  *  Postconditions:
        	  *    init'ed(java.lang.String:substring(...)._tainted)
        	  *    this.myItem == item
        	  *    init'ed(this.myItem)
        	  *    this.myOwner == One-of{&java.lang.String:substring(...), owner}
        	  *    this.myOwner != null
        	  *    this.myTime == time
        	  *    init'ed(this.myTime)
        	  * 
        	  *  Test Vectors:
        	  *    java.lang.String:charAt(...)@54: {0..57, 59..216-1}, {58}
        	  *    java.lang.String:isEmpty(...)@54: {1}, {0}
        	  */
    50  	public ChannelListModeItem(final String item, final String owner, final long time) {
    51  		myItem = item;
    52  		myTime = time;
    53  
    54  		if (!owner.isEmpty() && owner.charAt(0) == ':') {
    55  			myOwner = owner.substring(1);
    56  		} else {
    57  			myOwner = owner;
    58  		}
    59  	}
    60  	
    61  	/**
    62  	 * Get The Item itself.
    63  	 *
    64  	 * @return The Item itself.
    65  	 */
        	 /* 
    P/P 	  *  Method: String getItem()
        	  * 
        	  *  Postconditions:
        	  *    return_value == this.myItem
        	  *    init'ed(return_value)
        	  */
    66  	public String getItem() { return myItem; }
    67  	
    68  	/**
    69  	 * Get The Person who created the item.
    70  	 *
    71  	 * @return The Person who created the item.
    72  	 */
        	 /* 
    P/P 	  *  Method: String getOwner()
        	  * 
        	  *  Postconditions:
        	  *    return_value == this.myOwner
        	  *    init'ed(return_value)
        	  */
    73  	public String getOwner() { return myOwner; }
    74  	
    75  	/**
    76  	 * Get The Time the item was created.
    77  	 *
    78  	 * @return The Time the item was created.
    79  	 */
        	 /* 
    P/P 	  *  Method: long getTime()
        	  * 
        	  *  Postconditions:
        	  *    return_value == this.myTime
        	  *    init'ed(return_value)
        	  */
    80  	public long getTime() { return myTime; }
    81  	
    82  	/**
    83  	* Returns a String representation of this object.
    84  	*
    85  	* @return String representation of this object
    86  	*/
    87  	@Override
    88  	public String toString() {
        		 /* 
    P/P 		  *  Method: String toString()
        		  * 
        		  *  Postconditions:
        		  *    return_value == this.myItem
        		  *    init'ed(return_value)
        		  */
    89  		return getItem();
    90  	}
    91  
    92  }
    93  








SofCheck Inspector Build Version : 2.17854
ChannelListModeItem.java 2009-Jun-25 01:54:24
ChannelListModeItem.class 2009-Sep-02 17:04:12