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

📄 businessobject.java

📁 个人通讯录
💻 JAVA
字号:
public class BusinessObject {
    int currentPos;
    PropertiesUtil proutil;
    
    public BusinessObject(){
        currentPos = 0;
        proutil = new PropertiesUtil("config/telephone.dat");
	}
	
	
	public User first() {
		currentPos = 0;
		return proutil.getUsers().get(0);
	}


	public User previous() {//前一个成员
		if(currentPos >0){
			currentPos --;
		}
		return proutil.getUsers().get(currentPos);
	}


	public User next() {//下一个成员
		if(currentPos < proutil.getUsers().size() - 1){
			currentPos ++;
		}
		return proutil.getUsers().get(currentPos);
	}


	public User last() {
		currentPos = proutil.getUsers().size() - 1;
		return proutil.getUsers().get(currentPos);
	}
	

	public void saveUser(User user) {
		proutil.save(user);
		currentPos = proutil.getUsers().indexOf(user);
	}	
	
	public void deleteUser(int index){
		proutil.delete(index);		
	}
    
}

⌨️ 快捷键说明

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