⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 browser.java

📁 sourcode about java basic
💻 JAVA
字号:
package jsunit.java.source_core.net.jsunit.model;

import net.jsunit.utility.StringUtility;

import java.util.List;

public class Browser {

    public static final String DEFAULT_SYSTEM_BROWSER = "default";

    private String fileName;
    private String killCommand;
    private int id;

    public Browser(String fullFileName, int id) {
        this.id = id;
        List<String> launchAndKill = StringUtility.listFromSemiColonDelimitedString(fullFileName);
        this.fileName = launchAndKill.size() >= 1 ? launchAndKill.get(0) : null;
        this.killCommand = launchAndKill.size() >= 2 ? launchAndKill.get(1) : null;
    }

    public String getFileName() {
        return fileName;
    }

    public String getKillCommand() {
        return killCommand;
    }

    public int getId() {
        return id;
    }

    public boolean hasId(int anId) {
        return id == anId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        final Browser browser = (Browser) o;

        if (id != browser.id) return false;
        return !(fileName != null ? !fileName.equals(browser.fileName) : browser.fileName != null);

    }

    public int hashCode() {
        int result;
        result = (fileName != null ? fileName.hashCode() : 0);
        result = 29 * result + id;
        return result;
    }

    public boolean isDefault() {
        return fileName.equals(DEFAULT_SYSTEM_BROWSER);
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -