//# 0 errors, 176 messages
//#
/*
    //#ErrorLevel.java:1:1: class: com.dmdirc.logger.ErrorLevel
 * 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.logger;

import com.dmdirc.ui.IconManager;

import javax.swing.Icon;

/** Specific error levels allowed by Logger. */
public enum ErrorLevel {
    //#ErrorLevel.java:30: method: ErrorLevel[] com.dmdirc.logger.ErrorLevel.values()
    //#input(ErrorLevel[] values()): $VALUES
    //#input(ErrorLevel[] values()): $VALUES.length
    //#input(ErrorLevel[] values()): $VALUES[0..5]
    //#output(ErrorLevel[] values()): new ErrorLevel[](values#1) num objects
    //#output(ErrorLevel[] values()): return_value.length
    //#output(ErrorLevel[] values()): return_value[0..5]
    //#output(ErrorLevel[] values()): return_value
    //#new obj(ErrorLevel[] values()): new ErrorLevel[](values#1)
    //#pre[1] (ErrorLevel[] values()): (soft) init'ed($VALUES[0..5])
    //#post(ErrorLevel[] values()): return_value == &new ErrorLevel[](values#1)
    //#post(ErrorLevel[] values()): new ErrorLevel[](values#1) num objects == 1
    //#post(ErrorLevel[] values()): return_value.length == 5
    //#post(ErrorLevel[] values()): return_value[0..5] == One-of{$VALUES[0..5], undefined}
    //#ErrorLevel.java:30: end of method: ErrorLevel[] com.dmdirc.logger.ErrorLevel.values()
    //#ErrorLevel.java:30: method: ErrorLevel com.dmdirc.logger.ErrorLevel.valueOf(String)
    //#input(ErrorLevel valueOf(String)): __Descendant_Table[com/dmdirc/logger/ErrorLevel]
    //#input(ErrorLevel valueOf(String)): __Descendant_Table[others]
    //#input(ErrorLevel valueOf(String)): name
    //#output(ErrorLevel valueOf(String)): return_value
    //#presumption(ErrorLevel valueOf(String)): java.lang.Enum:valueOf(...).__Tag@30 == com/dmdirc/logger/ErrorLevel
    //#post(ErrorLevel valueOf(String)): init'ed(return_value)
    //#ErrorLevel.java:30: end of method: ErrorLevel com.dmdirc.logger.ErrorLevel.valueOf(String)
    /** Fatal error. */
    FATAL("Fatal", IconManager.getIconManager().getIcon("error")),
    //#ErrorLevel.java:32: method: com.dmdirc.logger.ErrorLevel.com.dmdirc.logger.ErrorLevel__static_init
    //#input(com.dmdirc.logger.ErrorLevel__static_init): "', and unable to load default"._tainted
    //#input(com.dmdirc.logger.ErrorLevel__static_init): ".png"._tainted
    //#input(com.dmdirc.logger.ErrorLevel__static_init): "Unable to load icon type '"._tainted
    //#input(com.dmdirc.logger.ErrorLevel__static_init): "com.dmdirc.res."._tainted
    //#input(com.dmdirc.logger.ErrorLevel__static_init): "dmdirc:..com.dmdirc.res."._tainted
    //#input(com.dmdirc.logger.ErrorLevel__static_init): com.dmdirc.ui.IconManager__static_init.new IconManager(IconManager__static_init#1).icons
    //#input(com.dmdirc.logger.ErrorLevel__static_init): com/dmdirc/ui/IconManager.ME
    //#output(com.dmdirc.logger.ErrorLevel__static_init): "error"._tainted
    //#output(com.dmdirc.logger.ErrorLevel__static_init): "info"._tainted
    //#output(com.dmdirc.logger.ErrorLevel__static_init): "warning"._tainted
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES
    //#output(com.dmdirc.logger.ErrorLevel__static_init): FATAL
    //#output(com.dmdirc.logger.ErrorLevel__static_init): HIGH
    //#output(com.dmdirc.logger.ErrorLevel__static_init): LOW
    //#output(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM
    //#output(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN
    //#output(com.dmdirc.logger.ErrorLevel__static_init): __Descendant_Table[com/dmdirc/logger/ErrorLevel]
    //#output(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.getIcon()Ljavax/swing/Icon;
    //#output(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.moreImportant(Lcom/dmdirc/logger/ErrorLevel;)Z
    //#output(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.toString()Ljava/lang/String;
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#1) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): FATAL.__Tag
    //#output(com.dmdirc.logger.ErrorLevel__static_init): FATAL.icon
    //#output(com.dmdirc.logger.ErrorLevel__static_init): FATAL.value
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#2) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): HIGH.__Tag
    //#output(com.dmdirc.logger.ErrorLevel__static_init): HIGH.icon
    //#output(com.dmdirc.logger.ErrorLevel__static_init): HIGH.value
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#3) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM.__Tag
    //#output(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM.icon
    //#output(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM.value
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#4) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): LOW.__Tag
    //#output(com.dmdirc.logger.ErrorLevel__static_init): LOW.icon
    //#output(com.dmdirc.logger.ErrorLevel__static_init): LOW.value
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#5) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN.__Tag
    //#output(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN.icon
    //#output(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN.value
    //#output(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel[](ErrorLevel__static_init#6) num objects
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES.length
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[0]
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[1]
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[2]
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[3]
    //#output(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[4]
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#1)
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#2)
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#3)
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#4)
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#5)
    //#new obj(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel[](ErrorLevel__static_init#6)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): "error"._tainted == 0
    //#post(com.dmdirc.logger.ErrorLevel__static_init): "info"._tainted == 0
    //#post(com.dmdirc.logger.ErrorLevel__static_init): "warning"._tainted == 0
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES == &new ErrorLevel[](ErrorLevel__static_init#6)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): FATAL == &new ErrorLevel(ErrorLevel__static_init#1)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[0] == &new ErrorLevel(ErrorLevel__static_init#1)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): HIGH == &new ErrorLevel(ErrorLevel__static_init#2)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[1] == &new ErrorLevel(ErrorLevel__static_init#2)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): LOW == &new ErrorLevel(ErrorLevel__static_init#4)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[3] == &new ErrorLevel(ErrorLevel__static_init#4)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM == &new ErrorLevel(ErrorLevel__static_init#3)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[2] == &new ErrorLevel(ErrorLevel__static_init#3)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN == &new ErrorLevel(ErrorLevel__static_init#5)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES[4] == &new ErrorLevel(ErrorLevel__static_init#5)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): __Descendant_Table[com/dmdirc/logger/ErrorLevel] == &__Dispatch_Table
    //#post(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.getIcon()Ljavax/swing/Icon; == &getIcon
    //#post(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.moreImportant(Lcom/dmdirc/logger/ErrorLevel;)Z == &moreImportant
    //#post(com.dmdirc.logger.ErrorLevel__static_init): __Dispatch_Table.toString()Ljava/lang/String; == &toString
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#1) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#2) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#3) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#4) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel(ErrorLevel__static_init#5) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): new ErrorLevel[](ErrorLevel__static_init#6) num objects == 1
    //#post(com.dmdirc.logger.ErrorLevel__static_init): FATAL.__Tag == com/dmdirc/logger/ErrorLevel
    //#post(com.dmdirc.logger.ErrorLevel__static_init): HIGH.__Tag == com/dmdirc/logger/ErrorLevel
    //#post(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM.__Tag == com/dmdirc/logger/ErrorLevel
    //#post(com.dmdirc.logger.ErrorLevel__static_init): LOW.__Tag == com/dmdirc/logger/ErrorLevel
    //#post(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN.__Tag == com/dmdirc/logger/ErrorLevel
    //#post(com.dmdirc.logger.ErrorLevel__static_init): init'ed(FATAL.icon)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): FATAL.value == &"Fatal"
    //#post(com.dmdirc.logger.ErrorLevel__static_init): init'ed(HIGH.icon)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): HIGH.value == &"High"
    //#post(com.dmdirc.logger.ErrorLevel__static_init): init'ed(MEDIUM.icon)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): MEDIUM.value == &"Medium"
    //#post(com.dmdirc.logger.ErrorLevel__static_init): init'ed(LOW.icon)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): LOW.value == &"Low"
    //#post(com.dmdirc.logger.ErrorLevel__static_init): init'ed(UNKNOWN.icon)
    //#post(com.dmdirc.logger.ErrorLevel__static_init): UNKNOWN.value == &"Unknown"
    //#post(com.dmdirc.logger.ErrorLevel__static_init): $VALUES.length == 5
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.Enum
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:com.dmdirc.config.IdentityManager:getGlobalConfig
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.Thread:currentThread
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.Thread:getContextClassLoader
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.ClassLoader:getResource
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:com.dmdirc.config.ConfigManager:hasOptionString
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:com.dmdirc.config.ConfigManager:getOption
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:com.dmdirc.util.URLBuilder:buildURL
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.lang.IllegalArgumentException
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.awt.Image:getScaledInstance
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.awt.Toolkit:getDefaultToolkit
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.awt.Toolkit:getImage
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:javax.swing.ImageIcon
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.util.Map:put
    //#unanalyzed(com.dmdirc.logger.ErrorLevel__static_init): Effects-of-calling:java.util.Map:get
    /** High priority error. */
    HIGH("High", IconManager.getIconManager().getIcon("error")),
    /** Medium priority error. */
    MEDIUM("Medium", IconManager.getIconManager().getIcon("warning")),
    /** Low priority error. */
    LOW("Low", IconManager.getIconManager().getIcon("info")),
    /** Unknown priority error. */
    UNKNOWN("Unknown", IconManager.getIconManager().getIcon("info"));
    //#ErrorLevel.java:40: end of method: com.dmdirc.logger.ErrorLevel.com.dmdirc.logger.ErrorLevel__static_init
    
    /** Error level string. */
    private String value;
    /** Error level icon. */
    private Icon icon;
    
    /** 
     * Instantiates the enum. 
     *
     * @param value toString value
     */
    ErrorLevel(final String value, final Icon icon) {
    //#ErrorLevel.java:52: method: void com.dmdirc.logger.ErrorLevel.com.dmdirc.logger.ErrorLevel(String, int, String, Icon)
    //#input(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): Param_1
    //#input(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): Param_2
    //#input(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): icon
    //#input(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): this
    //#input(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): value
    //#output(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): this.icon
    //#output(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): this.value
    //#post(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): this.icon == icon
    //#post(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): init'ed(this.icon)
    //#post(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): this.value == value
    //#post(void com.dmdirc.logger.ErrorLevel(String, int, String, Icon)): init'ed(this.value)
        this.value = value;
        this.icon = icon;
    }
    //#ErrorLevel.java:55: end of method: void com.dmdirc.logger.ErrorLevel.com.dmdirc.logger.ErrorLevel(String, int, String, Icon)
    
    /** {@inheritDoc} */
    @Override
    public String toString() {
        return value;
    //#ErrorLevel.java:60: method: String com.dmdirc.logger.ErrorLevel.toString()
    //#input(String toString()): this
    //#input(String toString()): this.value
    //#output(String toString()): return_value
    //#pre[2] (String toString()): init'ed(this.value)
    //#post(String toString()): return_value == this.value
    //#post(String toString()): init'ed(return_value)
    //#ErrorLevel.java:60: end of method: String com.dmdirc.logger.ErrorLevel.toString()
    }
    
    /**
     * Error levels icon.
     * 
     * @return Error levels icon
     */
    public Icon getIcon() {
        return icon;
    //#ErrorLevel.java:69: method: Icon com.dmdirc.logger.ErrorLevel.getIcon()
    //#input(Icon getIcon()): this
    //#input(Icon getIcon()): this.icon
    //#output(Icon getIcon()): return_value
    //#pre[2] (Icon getIcon()): init'ed(this.icon)
    //#post(Icon getIcon()): return_value == this.icon
    //#post(Icon getIcon()): init'ed(return_value)
    //#ErrorLevel.java:69: end of method: Icon com.dmdirc.logger.ErrorLevel.getIcon()
    }
    
    /**
     * Returns if the specified error is more important than this one
     *
     * @param level Error level to compare
     *
     * @return true iif the error is more important
     */
    public boolean moreImportant(final ErrorLevel level) {
        if (level == null) {
    //#ErrorLevel.java:80: method: bool com.dmdirc.logger.ErrorLevel.moreImportant(ErrorLevel)
    //#input(bool moreImportant(ErrorLevel)): level
    //#input(bool moreImportant(ErrorLevel)): this
    //#output(bool moreImportant(ErrorLevel)): return_value
    //#post(bool moreImportant(ErrorLevel)): init'ed(return_value)
    //#test_vector(bool moreImportant(ErrorLevel)): level: Inverse{null}, Addr_Set{null}
            return false;
        }
        
        return ordinal() > level.ordinal();
    //#ErrorLevel.java:84: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.logger.ErrorLevel:ordinal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.logger.ErrorLevel
    //#    method: bool moreImportant(ErrorLevel)
    //#    unanalyzed callee: int com.dmdirc.logger.ErrorLevel:ordinal()
    //#ErrorLevel.java:84: end of method: bool com.dmdirc.logger.ErrorLevel.moreImportant(ErrorLevel)
    }
}
    //#ErrorLevel.java:: end of class: com.dmdirc.logger.ErrorLevel
