//# 0 errors, 58 messages
//#
/*
    //#AccessLevelComponent.java:1:1: class: com.dmdirc.addons.userlevel.AccessLevelComponent
    //#AccessLevelComponent.java:1:1: method: com.dmdirc.addons.userlevel.AccessLevelComponent.com.dmdirc.addons.userlevel.AccessLevelComponent__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.addons.userlevel;

import com.dmdirc.actions.interfaces.ActionComponent;
import com.dmdirc.parser.irc.ClientInfo;

/**
 * Action component to retrieve a client's global access level.
 * 
 * @author chris
 */
public class AccessLevelComponent implements ActionComponent {
    //#AccessLevelComponent.java:33: method: void com.dmdirc.addons.userlevel.AccessLevelComponent.com.dmdirc.addons.userlevel.AccessLevelComponent()
    //#AccessLevelComponent.java:33: end of method: void com.dmdirc.addons.userlevel.AccessLevelComponent.com.dmdirc.addons.userlevel.AccessLevelComponent()

    /** {@inheritDoc} */
    @Override
    public Object get(final Object argument) {
        UserLevelPlugin.doGlobalLevel((ClientInfo) argument);
    //#AccessLevelComponent.java:38: method: Object com.dmdirc.addons.userlevel.AccessLevelComponent.get(Object)
    //#input(Object get(Object)): "!"._tainted
    //#input(Object get(Object)): "@"._tainted
    //#input(Object get(Object)): argument
    //#input(Object get(Object)): com/dmdirc/addons/userlevel/UserLevelPlugin.LEVELS
    //#output(Object get(Object)): return_value
    //#pre[1] (Object get(Object)): argument != null
    //#presumption(Object get(Object)): com.dmdirc.parser.irc.ClientInfo:getMap(...)@39 != null
    //#post(Object get(Object)): init'ed(return_value)
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(Object get(Object)): Effects-of-calling:com.dmdirc.parser.irc.ClientInfo:getNickname
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(Object get(Object)): Effects-of-calling:com.dmdirc.parser.irc.ClientInfo:getIdent
    //#unanalyzed(Object get(Object)): Effects-of-calling:com.dmdirc.parser.irc.ClientInfo:getHost
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Map:entrySet
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.String:matches
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.Integer:intValue
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.Math:max
    //#unanalyzed(Object get(Object)): Effects-of-calling:com.dmdirc.parser.irc.ClientInfo:getMap
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.Integer:valueOf
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(Object get(Object)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
        return ((ClientInfo) argument).getMap().get("level");
    //#AccessLevelComponent.java:39: Warning: method not available - call not analyzed
    //#    call on Map com.dmdirc.parser.irc.ClientInfo:getMap()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.userlevel.AccessLevelComponent
    //#    method: Object get(Object)
    //#    unanalyzed callee: Map com.dmdirc.parser.irc.ClientInfo:getMap()
    //#AccessLevelComponent.java:39: end of method: Object com.dmdirc.addons.userlevel.AccessLevelComponent.get(Object)
    }

    /** {@inheritDoc} */
    @Override    
    public Class appliesTo() {
        return ClientInfo.class;
    //#AccessLevelComponent.java:45: method: Class com.dmdirc.addons.userlevel.AccessLevelComponent.appliesTo()
    //#output(Class appliesTo()): return_value
    //#post(Class appliesTo()): return_value == &com.dmdirc.parser.irc.ClientInfo.__Class_Obj
    //#AccessLevelComponent.java:45: end of method: Class com.dmdirc.addons.userlevel.AccessLevelComponent.appliesTo()
    }

    /** {@inheritDoc} */
    @Override    
    public Class getType() {
        return Integer.class;
    //#AccessLevelComponent.java:51: method: Class com.dmdirc.addons.userlevel.AccessLevelComponent.getType()
    //#output(Class getType()): return_value
    //#post(Class getType()): return_value == &java.lang.Integer.__Class_Obj
    //#AccessLevelComponent.java:51: end of method: Class com.dmdirc.addons.userlevel.AccessLevelComponent.getType()
    }

    /** {@inheritDoc} */
    @Override    
    public String getName() {
        return "access level";
    //#AccessLevelComponent.java:57: method: String com.dmdirc.addons.userlevel.AccessLevelComponent.getName()
    //#output(String getName()): return_value
    //#post(String getName()): return_value == &"access level"
    //#AccessLevelComponent.java:57: end of method: String com.dmdirc.addons.userlevel.AccessLevelComponent.getName()
    }

}
    //#output(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Descendant_Table[com/dmdirc/addons/userlevel/AccessLevelComponent]
    //#output(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.appliesTo()Ljava/lang/Class;
    //#output(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.get(Ljava/lang/Object;)Ljava/lang/Object;
    //#output(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.getName()Ljava/lang/String;
    //#output(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.getType()Ljava/lang/Class;
    //#post(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Descendant_Table[com/dmdirc/addons/userlevel/AccessLevelComponent] == &__Dispatch_Table
    //#post(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.appliesTo()Ljava/lang/Class; == &appliesTo
    //#post(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.get(Ljava/lang/Object;)Ljava/lang/Object; == &get
    //#post(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.getName()Ljava/lang/String; == &getName
    //#post(com.dmdirc.addons.userlevel.AccessLevelComponent__static_init): __Dispatch_Table.getType()Ljava/lang/Class; == &getType
    //#AccessLevelComponent.java:: end of method: com.dmdirc.addons.userlevel.AccessLevelComponent.com.dmdirc.addons.userlevel.AccessLevelComponent__static_init
    //#AccessLevelComponent.java:: end of class: com.dmdirc.addons.userlevel.AccessLevelComponent
