shortmessage.java

来自「一个SMS 的短信平台的原代码」· Java 代码 · 共 106 行

JAVA
106
字号
package edu.soft.buaa.message.sms;

import java.util.Date;

public class ShortMessage {
	
	protected String id;
	protected int memIndex;
	protected Date date;
	protected String originator;
	protected String recipient;
	protected String text;
	protected int messageEncoding;
	public ShortMessage(Date date, String originator, String recipient, String text, int memIndex)
	{
		
		this.date = date;
		this.originator = originator;
		this.recipient = recipient;
		this.text = text;
		this.memIndex = memIndex;
		
	}
	
	public ShortMessage(String recipient, String text)
	{
		
		
		this.recipient = recipient;
		this.text = text;
	
		
	}
	

/**
	Returns the id of the message.

	@return  the id of the message.
*/
public String getId() { return id; }

/**
	Returns the memory index of the GSM device, where the message is stored.
	Applicable only for incoming messages.

	@return  the memory index of the message.
*/
public int getMemIndex() { return memIndex; }

/**
	Returns the date of the message. For incoming messages, this is the sent date.
	For outgoing messages, this is the creation date.

	@return  the date of the message.
*/
public Date getDate() { return date; }

/**
	返回发送者的手机号

	@return  发送者的手机号.
*/
public String getFromPhone() { return originator; }

/**
	返回接收者的手机号

	@return  接收者的手机号.
*/
public String getToPhone() { return recipient; }

/**
	Returns the actual text of the message .

	@return  the text of the message.
*/
public String getText() { return text; }




/**
	Set the id of the message.

	@param	id	the id of the message.
*/
public void setId(String id) { this.id = id; }

/**
	Set the text of the message.

	@param	text	the text of the message.
*/
public void setText(String text) { this.text = text; }

/**
	Set the date of the message.

	@param	date	the date of the message.
*/
public void setDate(Date date) { this.date = date; }

	
}

⌨️ 快捷键说明

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