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

📄 businessobject.java

📁 使用netbeans 开发的 java手机通讯录。 主要就是一般的手机通讯录的功能
💻 JAVA
字号:
package com.lovo.addressbook;import java.util.List;public class BusinessObject {    int currentPos;    User[] users;    PropertiesUtil proutil;    private String fileName = "config/telephone.dat";        public BusinessObject(){        currentPos = 0;        proutil = new PropertiesUtil(fileName);        users = getAllUsers();	}		public User[] getAllUsers() {		List <User> list = proutil.getUsers();		User[] users2 = new User[list.size()];		for(int i =0;i<list.size();i++){			users2[i]=list.get(i);		}		return users2;	}	public User first() {		currentPos =0;		return users[currentPos];	}	public User previous() {		if(currentPos >0){			currentPos --;		}		return users[currentPos];	}	public User next() {		if(currentPos < users.length - 1){			currentPos ++;		}		return users[currentPos];	}	public User last() {		currentPos = users.length - 1;		return users[currentPos];	}	public void saveUser(User user) {		proutil.save(user);		users = getAllUsers();		currentPos = Integer.parseInt(user.getNo()) - 1;	}        }

⌨️ 快捷键说明

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