//# 0 errors, 65 messages
//#
/*
    //#ActionTypeComparator.java:1:1: class: com.dmdirc.actions.ActionTypeComparator
    //#ActionTypeComparator.java:1:1: method: com.dmdirc.actions.ActionTypeComparator.com.dmdirc.actions.ActionTypeComparator__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.actions;

import com.dmdirc.actions.interfaces.ActionType;

import java.io.Serializable;
import java.util.Comparator;

/**
 * Implements a comparator for action types that compares their names.
 * 
 * @author Chris
 */
public final class ActionTypeComparator implements Comparator<ActionType>, Serializable {
    //#ActionTypeComparator.java:35: method: int com.dmdirc.actions.ActionTypeComparator.compare(Object, Object)
    //#ActionTypeComparator.java:35: Warning: suspicious precondition
    //#    The precondition for x0.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.actions.ActionTypeComparator
    //#    method: int compare(Object, Object)
    //#    suspicious precondition index: [3]
    //#    Attribs:  Soft
    //#ActionTypeComparator.java:35: Warning: suspicious precondition
    //#    The precondition for x1.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.actions.ActionTypeComparator
    //#    method: int compare(Object, Object)
    //#    suspicious precondition index: [7]
    //#    Attribs:  Soft
    //#input(int compare(Object, Object)): com/dmdirc/actions/CoreActionType.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(Object, Object)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/actions/CoreActionType]
    //#input(int compare(Object, Object)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/actions/interfaces/ActionType]
    //#input(int compare(Object, Object)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/addons/dcc/actions/DCCActions]
    //#input(int compare(Object, Object)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[others]
    //#input(int compare(Object, Object)): com/dmdirc/actions/interfaces/ActionType.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(Object, Object)): com/dmdirc/addons/dcc/actions/DCCActions.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(Object, Object)): this
    //#input(int compare(Object, Object)): x0
    //#input(int compare(Object, Object)): x0.__Tag
    //#input(int compare(Object, Object)): x0.name
    //#input(int compare(Object, Object)): x1
    //#input(int compare(Object, Object)): x1.__Tag
    //#input(int compare(Object, Object)): x1.name
    //#output(int compare(Object, Object)): return_value
    //#pre[2] (int compare(Object, Object)): x0 != null
    //#pre[6] (int compare(Object, Object)): x1 != null
    //#pre[3] (int compare(Object, Object)): (soft) x0.__Tag in {com/dmdirc/actions/CoreActionType, com/dmdirc/actions/interfaces/ActionType, com/dmdirc/addons/dcc/actions/DCCActions}
    //#pre[4] (int compare(Object, Object)): (soft) x0.name != null
    //#pre[5] (int compare(Object, Object)): (soft) x0.name != null
    //#pre[7] (int compare(Object, Object)): (soft) x1.__Tag in {com/dmdirc/actions/CoreActionType, com/dmdirc/actions/interfaces/ActionType, com/dmdirc/addons/dcc/actions/DCCActions}
    //#post(int compare(Object, Object)): init'ed(return_value)
    //#unanalyzed(int compare(Object, Object)): Effects-of-calling:getName
    //#unanalyzed(int compare(Object, Object)): Effects-of-calling:java.lang.String:compareTo
    //#ActionTypeComparator.java:35: end of method: int com.dmdirc.actions.ActionTypeComparator.compare(Object, Object)

    /**
     * A version number for this class. It should be changed whenever the class
     * structure is changed (or anything else that would prevent serialized
     * objects being unserialized with the new class).
     */
    private static final long serialVersionUID = 1;        
    
    /**
     * Creates a new instance of ActionTypeComparator.
     */
    public ActionTypeComparator() {
    //#ActionTypeComparator.java:47: method: void com.dmdirc.actions.ActionTypeComparator.com.dmdirc.actions.ActionTypeComparator()
        // Do nothing
    }
    //#ActionTypeComparator.java:49: end of method: void com.dmdirc.actions.ActionTypeComparator.com.dmdirc.actions.ActionTypeComparator()

    /** {@inheritDoc} */
    @Override
    public int compare(final ActionType o1, final ActionType o2) {
        return o1.getName().compareTo(o2.getName());
    //#ActionTypeComparator.java:54: method: int com.dmdirc.actions.ActionTypeComparator.compare(ActionType, ActionType)
    //#ActionTypeComparator.java:54: Warning: suspicious precondition
    //#    The precondition for o1.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.actions.ActionTypeComparator
    //#    method: int compare(ActionType, ActionType)
    //#    suspicious precondition index: [2]
    //#ActionTypeComparator.java:54: Warning: suspicious precondition
    //#    The precondition for o2.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.actions.ActionTypeComparator
    //#    method: int compare(ActionType, ActionType)
    //#    suspicious precondition index: [6]
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/CoreActionType.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/actions/CoreActionType]
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/actions/interfaces/ActionType]
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[com/dmdirc/addons/dcc/actions/DCCActions]
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/interfaces/ActionType.__Descendant_Table[others]
    //#input(int compare(ActionType, ActionType)): com/dmdirc/actions/interfaces/ActionType.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(ActionType, ActionType)): com/dmdirc/addons/dcc/actions/DCCActions.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(int compare(ActionType, ActionType)): o1
    //#input(int compare(ActionType, ActionType)): o1.__Tag
    //#input(int compare(ActionType, ActionType)): o1.name
    //#input(int compare(ActionType, ActionType)): o2
    //#input(int compare(ActionType, ActionType)): o2.__Tag
    //#input(int compare(ActionType, ActionType)): o2.name
    //#output(int compare(ActionType, ActionType)): return_value
    //#pre[1] (int compare(ActionType, ActionType)): o1 != null
    //#pre[2] (int compare(ActionType, ActionType)): o1.__Tag in {com/dmdirc/actions/CoreActionType, com/dmdirc/actions/interfaces/ActionType, com/dmdirc/addons/dcc/actions/DCCActions}
    //#pre[5] (int compare(ActionType, ActionType)): o2 != null
    //#pre[6] (int compare(ActionType, ActionType)): o2.__Tag in {com/dmdirc/actions/CoreActionType, com/dmdirc/actions/interfaces/ActionType, com/dmdirc/addons/dcc/actions/DCCActions}
    //#pre[3] (int compare(ActionType, ActionType)): (soft) o1.name != null
    //#pre[4] (int compare(ActionType, ActionType)): (soft) o1.name != null
    //#post(int compare(ActionType, ActionType)): init'ed(return_value)
    //#ActionTypeComparator.java:54: end of method: int com.dmdirc.actions.ActionTypeComparator.compare(ActionType, ActionType)
    }

}
    //#output(com.dmdirc.actions.ActionTypeComparator__static_init): __Descendant_Table[com/dmdirc/actions/ActionTypeComparator]
    //#output(com.dmdirc.actions.ActionTypeComparator__static_init): __Dispatch_Table.compare(Lcom/dmdirc/actions/interfaces/ActionType;Lcom/dmdirc/actions/interfaces/ActionType;)I
    //#output(com.dmdirc.actions.ActionTypeComparator__static_init): __Dispatch_Table.compare(Ljava/lang/Object;Ljava/lang/Object;)I
    //#post(com.dmdirc.actions.ActionTypeComparator__static_init): __Descendant_Table[com/dmdirc/actions/ActionTypeComparator] == &__Dispatch_Table
    //#post(com.dmdirc.actions.ActionTypeComparator__static_init): __Dispatch_Table.compare(Lcom/dmdirc/actions/interfaces/ActionType;Lcom/dmdirc/actions/interfaces/ActionType;)I == &compare
    //#post(com.dmdirc.actions.ActionTypeComparator__static_init): __Dispatch_Table.compare(Ljava/lang/Object;Ljava/lang/Object;)I == &compare
    //#ActionTypeComparator.java:: end of method: com.dmdirc.actions.ActionTypeComparator.com.dmdirc.actions.ActionTypeComparator__static_init
    //#ActionTypeComparator.java:: end of class: com.dmdirc.actions.ActionTypeComparator
