package com.dss.tpservice.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public class DataBean {
    private int count;
    private String exitAction;
    private String exitShell;
    private String startAction;
    private String startShell;
    private String type;
    private final Map<String, Integer> windowBinderMap = new HashMap();
    private final List<Integer> taskIdList = new ArrayList();

    public String getType() {
        return this.type;
    }

    public String getStartShell() {
        return this.startShell;
    }

    public String getExitShell() {
        return this.exitShell;
    }

    public String getStartAction() {
        return this.startAction;
    }

    public String getExitAction() {
        return this.exitAction;
    }

    public int getCount() {
        return this.count;
    }

    public boolean addNewTask(int i) {
        if (this.taskIdList.contains(Integer.valueOf(i))) {
            return false;
        }
        if (this.taskIdList.add(Integer.valueOf(i))) {
            this.count++;
        }
        return true;
    }

    public boolean removeTask(int i) {
        if (!this.taskIdList.contains(Integer.valueOf(i))) {
            return false;
        }
        if (this.taskIdList.remove(Integer.valueOf(i))) {
            int i2 = this.count - 1;
            this.count = i2;
            if (i2 < 0) {
                this.count = 0;
            }
        }
        return true;
    }

    public boolean addWindow(String str) {
        int iIntValue = 0;
        boolean z = true;
        if (this.windowBinderMap.containsKey(str)) {
            this.windowBinderMap.put(str, Integer.valueOf(this.windowBinderMap.get(str).intValue() + 1));
            z = false;
        } else {
            this.windowBinderMap.put(str, 1);
        }
        Iterator<Integer> it = this.windowBinderMap.values().iterator();
        while (it.hasNext()) {
            iIntValue += it.next().intValue();
        }
        this.count = iIntValue;
        return z;
    }

    public boolean removeWindow(String str) {
        int iIntValue = 0;
        if (!this.windowBinderMap.containsKey(str)) {
            return false;
        }
        Integer numValueOf = Integer.valueOf(this.windowBinderMap.get(str).intValue() - 1);
        if (numValueOf.intValue() <= 0) {
            this.windowBinderMap.remove(str);
        } else {
            this.windowBinderMap.put(str, numValueOf);
        }
        Iterator<Integer> it = this.windowBinderMap.values().iterator();
        while (it.hasNext()) {
            iIntValue += it.next().intValue();
        }
        this.count = iIntValue;
        return true;
    }

    public boolean isContainTask(int i) {
        return this.taskIdList.contains(Integer.valueOf(i));
    }

    public String toString() {
        return "DataBean{type='" + this.type + "', startShell='" + this.startShell + "', exitShell='" + this.exitShell + "', startAction='" + this.startAction + "', exitAction='" + this.exitAction + "', count=" + this.count + ", windowBinderMap=" + this.windowBinderMap + ", taskIdList=" + this.taskIdList + '}';
    }
}
