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

📄 phoneitem.java

📁 手机电话本 初学者
💻 JAVA
字号:
/*
 * Created on 2005-2-3
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package net.garrey.model;

/**
 * @author Administrator
 * Written by Garrey. All rights reserved by Garrey.
 */
public class PhoneItem {
	private int id;
    private String phonenum=null;
    private String name=null;
    
    public PhoneItem(String name,String phonenum){
        this.name=name;
        this.phonenum=phonenum;
    }
    
    public PhoneItem(int id,byte[] data){
        this.id=id;
    	String temp=new String(data);
        int ind=temp.indexOf(",");
        if(ind!=-1){
            name=temp.substring(0,ind);
            phonenum=temp.substring(ind+1);
        }
    }
    
    public int getId(){
    	return id;
    }
    
    public void setId(int id){
    	this.id=id;
    }
    
    public String getPhonenum(){
        return phonenum;
    }
    
    public void setPhonenum(String num){
        phonenum=num;
    }
    
    public String getName(){
        return name;
    }
    
    public void setName(String na){
        name=na;
    }
    
    public byte[] getBytes(){
        String temp=null;
        if(name==null||phonenum==null){
            return null;
        }else{
            temp=name+","+phonenum;
        }
        return temp.getBytes();
    }
}

⌨️ 快捷键说明

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