//# 0 errors, 35 messages
//#
/*
    //#TabCompletionResult.java:1:1: class: com.dmdirc.ui.input.tabstyles.TabCompletionResult
    //#TabCompletionResult.java:1:1: method: com.dmdirc.ui.input.tabstyles.TabCompletionResult.com.dmdirc.ui.input.tabstyles.TabCompletionResult__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.ui.input.tabstyles;

/**
 * Details the proposed result of tab completion. Results consist of a
 * new string (to replace the current one), and a new caret position.
 */
public class TabCompletionResult {
    
    /** The new string to use in the result. */
    private final String text;
    
    /** The new caret position to be used. */
    private final int position;
    
    /**
     * Creates a new instance of TabCompletionResult.
     *
     * @param text The text for this result
     * @param position The caret position for this result
     */
    public TabCompletionResult(final String text, final int position) {
    //#TabCompletionResult.java:43: method: void com.dmdirc.ui.input.tabstyles.TabCompletionResult.com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)
    //#input(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): position
    //#input(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): text
    //#input(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): this
    //#output(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): this.position
    //#output(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): this.text
    //#post(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): this.position == position
    //#post(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): init'ed(this.position)
    //#post(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): this.text == text
    //#post(void com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)): init'ed(this.text)
        this.text = text;
        this.position = position;
    }
    //#TabCompletionResult.java:46: end of method: void com.dmdirc.ui.input.tabstyles.TabCompletionResult.com.dmdirc.ui.input.tabstyles.TabCompletionResult(String, int)
    
    /**
     * Retrieves the replacement string for this result.
     *
     * @return This result's text
     */
    public String getText() {
        return text;
    //#TabCompletionResult.java:54: method: String com.dmdirc.ui.input.tabstyles.TabCompletionResult.getText()
    //#input(String getText()): this
    //#input(String getText()): this.text
    //#output(String getText()): return_value
    //#post(String getText()): return_value == this.text
    //#post(String getText()): init'ed(return_value)
    //#TabCompletionResult.java:54: end of method: String com.dmdirc.ui.input.tabstyles.TabCompletionResult.getText()
    }
    
    /**
     * Retrieves the new caret position for this result.
     *
     * @return This result's caret position
     */
    public int getPosition() {
        return position;
    //#TabCompletionResult.java:63: method: int com.dmdirc.ui.input.tabstyles.TabCompletionResult.getPosition()
    //#input(int getPosition()): this
    //#input(int getPosition()): this.position
    //#output(int getPosition()): return_value
    //#post(int getPosition()): return_value == this.position
    //#post(int getPosition()): init'ed(return_value)
    //#TabCompletionResult.java:63: end of method: int com.dmdirc.ui.input.tabstyles.TabCompletionResult.getPosition()
    }
    
}    //#output(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Descendant_Table[com/dmdirc/ui/input/tabstyles/TabCompletionResult]
    //#output(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Dispatch_Table.getPosition()I
    //#output(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Dispatch_Table.getText()Ljava/lang/String;
    //#post(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Descendant_Table[com/dmdirc/ui/input/tabstyles/TabCompletionResult] == &__Dispatch_Table
    //#post(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Dispatch_Table.getPosition()I == &getPosition
    //#post(com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init): __Dispatch_Table.getText()Ljava/lang/String; == &getText
    //#TabCompletionResult.java:: end of method: com.dmdirc.ui.input.tabstyles.TabCompletionResult.com.dmdirc.ui.input.tabstyles.TabCompletionResult__static_init
    //#TabCompletionResult.java:: end of class: com.dmdirc.ui.input.tabstyles.TabCompletionResult
