//# 0 errors, 76 messages
//#
/*
    //#IgnoreListModel.java:1:1: class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#IgnoreListModel.java:1:1: method: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__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.ui_swing.dialogs.serversetting;

import com.dmdirc.IgnoreList;
import javax.swing.AbstractListModel;

/**
 *
 * @author chris
 */
public class IgnoreListModel extends AbstractListModel {

    /**
     * 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;

    private final IgnoreList ignoreList;

    private boolean isSimple;

    public IgnoreListModel(IgnoreList ignoreList) {
    //#IgnoreListModel.java:44: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): ignoreList
    //#input(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): this
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): this.ignoreList
    //#output(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): this.isSimple
    //#pre[1] (void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): ignoreList != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): this.ignoreList == ignoreList
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): this.ignoreList != null
    //#post(void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)): init'ed(this.isSimple)
        this.ignoreList = ignoreList;
        isSimple = ignoreList.canConvert();
    //#IgnoreListModel.java:46: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.IgnoreList:canConvert()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)
    //#    unanalyzed callee: bool com.dmdirc.IgnoreList:canConvert()
    }
    //#IgnoreListModel.java:47: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel(IgnoreList)

    /** {@inheritDoc} */
    @Override
    public int getSize() {
        return ignoreList.count();
    //#IgnoreListModel.java:52: method: int com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.getSize()
    //#IgnoreListModel.java:52: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.IgnoreList:count()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: int getSize()
    //#    unanalyzed callee: int com.dmdirc.IgnoreList:count()
    //#input(int getSize()): this
    //#input(int getSize()): this.ignoreList
    //#output(int getSize()): return_value
    //#pre[2] (int getSize()): this.ignoreList != null
    //#post(int getSize()): init'ed(return_value)
    //#IgnoreListModel.java:52: end of method: int com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.getSize()
    }

    /** {@inheritDoc} */
    @Override
    public Object getElementAt(final int index) {
        if (isSimple) {
    //#IgnoreListModel.java:58: method: Object com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.getElementAt(int)
    //#input(Object getElementAt(int)): index
    //#input(Object getElementAt(int)): this
    //#input(Object getElementAt(int)): this.ignoreList
    //#input(Object getElementAt(int)): this.isSimple
    //#output(Object getElementAt(int)): return_value
    //#pre[3] (Object getElementAt(int)): this.ignoreList != null
    //#pre[4] (Object getElementAt(int)): init'ed(this.isSimple)
    //#presumption(Object getElementAt(int)): com.dmdirc.IgnoreList:getRegexList(...)@61 != null
    //#presumption(Object getElementAt(int)): com.dmdirc.IgnoreList:getSimpleList(...)@59 != null
    //#post(Object getElementAt(int)): init'ed(return_value)
    //#test_vector(Object getElementAt(int)): this.isSimple: {0}, {1}
            return ignoreList.getSimpleList().get(index);
    //#IgnoreListModel.java:59: Warning: method not available - call not analyzed
    //#    call on List com.dmdirc.IgnoreList:getSimpleList()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: Object getElementAt(int)
    //#    unanalyzed callee: List com.dmdirc.IgnoreList:getSimpleList()
        } else {
            return ignoreList.getRegexList().get(index);
    //#IgnoreListModel.java:61: Warning: method not available - call not analyzed
    //#    call on List com.dmdirc.IgnoreList:getRegexList()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: Object getElementAt(int)
    //#    unanalyzed callee: List com.dmdirc.IgnoreList:getRegexList()
    //#IgnoreListModel.java:61: end of method: Object com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.getElementAt(int)
        }
    }

    public void setIsSimple(boolean isSimple) {
        this.isSimple = isSimple;
    //#IgnoreListModel.java:66: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.setIsSimple(bool)
    //#input(void setIsSimple(bool)): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel]
    //#input(void setIsSimple(bool)): __Descendant_Table[others]
    //#input(void setIsSimple(bool)): __Dispatch_Table.getSize()I
    //#input(void setIsSimple(bool)): isSimple
    //#input(void setIsSimple(bool)): this
    //#input(void setIsSimple(bool)): this.__Tag
    //#input(void setIsSimple(bool)): this.ignoreList
    //#output(void setIsSimple(bool)): this.isSimple
    //#pre[3] (void setIsSimple(bool)): this.__Tag == com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel
    //#pre[4] (void setIsSimple(bool)): this.ignoreList != null
    //#post(void setIsSimple(bool)): this.isSimple == isSimple
    //#post(void setIsSimple(bool)): init'ed(this.isSimple)
    //#unanalyzed(void setIsSimple(bool)): Effects-of-calling:com.dmdirc.IgnoreList:count

        fireContentsChanged(this, 0, getSize());
    //#IgnoreListModel.java:68: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel:fireContentsChanged(Object, int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: void setIsSimple(bool)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel:fireContentsChanged(Object, int, int)
    }
    //#IgnoreListModel.java:69: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.setIsSimple(bool)
    
    public void notifyUpdated() {
        fireContentsChanged(this, 0, getSize());
    //#IgnoreListModel.java:72: method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.notifyUpdated()
    //#IgnoreListModel.java:72: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel:fireContentsChanged(Object, int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
    //#    method: void notifyUpdated()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel:fireContentsChanged(Object, int, int)
    //#input(void notifyUpdated()): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel]
    //#input(void notifyUpdated()): __Descendant_Table[others]
    //#input(void notifyUpdated()): __Dispatch_Table.getSize()I
    //#input(void notifyUpdated()): this
    //#input(void notifyUpdated()): this.__Tag
    //#input(void notifyUpdated()): this.ignoreList
    //#pre[2] (void notifyUpdated()): this.__Tag == com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel
    //#pre[3] (void notifyUpdated()): this.ignoreList != null
    //#unanalyzed(void notifyUpdated()): Effects-of-calling:com.dmdirc.IgnoreList:count
    }
    //#IgnoreListModel.java:73: end of method: void com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.notifyUpdated()

}
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel]
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.getElementAt(I)Ljava/lang/Object;
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.getSize()I
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.notifyUpdated()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.setIsSimple(Z)V
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/serversetting/IgnoreListModel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.getElementAt(I)Ljava/lang/Object; == &getElementAt
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.getSize()I == &getSize
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.notifyUpdated()V == &notifyUpdated
    //#post(com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init): __Dispatch_Table.setIsSimple(Z)V == &setIsSimple
    //#IgnoreListModel.java:: end of method: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel.com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel__static_init
    //#IgnoreListModel.java:: end of class: com.dmdirc.addons.ui_swing.dialogs.serversetting.IgnoreListModel
