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

📄 modeconfirm.java

📁 图书管管理系统是基于JAVA的 很好的
💻 JAVA
字号:
/*
 * ModeConfirm.java
 *
 * Created on 2007年11月10日, 下午2:15
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package h6.action;

/**
 *
 * @author dinga
 */
/**
 *该类定义了模式确定的各个方法。
 *Popedom表示当前登录的权限,共有12位
 *第0位表示书籍借阅
 *第1位表示书籍归还
 *第2位表示读者帐户的添加
 *第3位表示读者帐户的修改
 *第4位表示读者帐户的删除
 *第5位表示管理员帐户的添加
 *第6位表示管理员帐户的修改
 *第7位表示管理员帐户的删除
 *第8位表示书籍信息的添加
 *第9位表示书籍信息的修改
 *第10位表示书籍信息的删除
 *第11位表示管理意见簿以及书籍荐购
 */
public class ModeConfirm {
    private String popedom;
    public static final int lendBook = 0;
    public static final int returnBook = 1;
    public static final int addReader = 2;
    public static final int updateReader = 3;
    public static final int deleteReader = 4;
    public static final int addAdministrator = 5;
    public static final int updateAdministrator = 6;
    public static final int deleteAdministrator = 7;
    public static final int addBook = 8;
    public static final int updateBook = 9;
    public static final int deleteBook = 10;
    public static final int advice = 11;
    /** Creates a new instance of ModeConfirm */
    
    /**
     *构造方法,默认为匿名登录,无任何权限
     */
    public ModeConfirm() {
        this("000000000000");
    }
    
    /**
     *构造方法,根据参数设置权限
     *@param newPopedom 初始时的权限
     */
    public ModeConfirm(String newPopedom){
        this.popedom = newPopedom;
    }
    
    /**
     *该方法用于设置权限
     *@param newPopedom 新设置的权限
     */
    public void setPopedom(String newPopedom){
        this.popedom = newPopedom;
    }
    
    /**
     *该方法用于获取权限
     *@return 当前的权限
     */
    public String getPopedom(){
        return this.popedom;
    }
    
    /**
     *该方法用于判断当前的权限能否做某些操作
     *@param action 指名查询何种操作,具体值的含义参照类定义
     *@return 有权限返回true
     *@return 没有权限返回false
     */ 
    public boolean beEntitledTo(int action){       
        return (this.popedom.charAt(action) == '1');
    }
}

⌨️ 快捷键说明

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