亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? message.java

?? 發送短信 接收短信 多種接口com/net/modem 開發庫
?? JAVA
字號:
// SMSLib for Java v3
// A Java API library for sending and receiving SMS via a GSM modem
// or other supported gateways.
// Web Site: http://www.smslib.org
//
// Copyright (C) 2002-2009, Thanasis Delenikas, Athens/GREECE.
// SMSLib is distributed under the terms of the Apache License version 2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.smslib;

import java.io.*;
import java.util.*;

/**
 * The parent of all message-related classes. Most of common fields and
 * attributes of both inbound and outbound messages are placed in this class.
 */
public abstract class Message implements Serializable
{
	private static final long serialVersionUID = 4461754947231415569L;

	private static long messageIdSeed = 0;

	private final long messageId;

	/**
	 * Enumeration representing available message encodings.
	 */
	public enum MessageEncodings
	{
		/**
		 * 7 bit encoding - standard GSM alphabet.
		 */
		ENC7BIT,
		/**
		 * 8 bit encoding.
		 */
		ENC8BIT,
		/**
		 * UCS2 (Unicode) encoding.
		 */
		ENCUCS2,
		/**
		 * Custom encoding. Currently just defaults to 7-bit.
		 */
		ENCCUSTOM
	}

	/**
	 * Enumeration representing the different message classes.
	 */
	public enum MessageClasses
	{
		/**
		 * Default option to set no message class meaning.
		 */
		MSGCLASS_NONE,
		/**
		 * Class 0 - Immediate display (alert).
		 */
		MSGCLASS_FLASH,
		/**
		 * Class 1 - ME specific
		 */
		MSGCLASS_ME,
		/**
		 * Classs 2 - SIM specific
		 */
		MSGCLASS_SIM,
		/**
		 * Class 3 - TE specific
		 */
		MSGCLASS_TE
	}

	/**
	 * Enumeration representing the different types of messages.
	 */
	public enum MessageTypes
	{
		/**
		 * Inbound message.
		 */
		INBOUND,
		/**
		 * Outbound message.
		 */
		OUTBOUND,
		/**
		 * Status (delivery) report message
		 */
		STATUSREPORT,
		/**
		 * Outbound WAP SI message.
		 */
		WAPSI,
		/**
		 * Unknown message.
		 */
		UNKNOWN
	}

	private String gtwId;

	private MessageTypes type;

	private Date date;

	private String id;

	private String text;

	private MessageEncodings encoding;

	private MessageClasses messageClass;

	protected int dstPort;

	protected int srcPort;

	protected int messageCharCount;

	public Message(MessageTypes myType, Date myDate, String myText)
	{
		this.messageId = messageIdSeed++;
		setGatewayId("");
		setType(myType);
		setId("");
		setDate(myDate);
		if (myText != null) setText(myText);
		setEncoding(MessageEncodings.ENC7BIT);
		setSrcPort(-1);
		setDstPort(-1);
		this.messageCharCount = 0;
	}

	/**
	 * Returns the creation date. For outbound messages, this is the object's
	 * creation date. For inbound messages, this is the date when the originator
	 * has sent the message.
	 * 
	 * @return the creation date.
	 * @see #setDate(Date)
	 */
	public Date getDate()
	{
		return this.date == null ? null : new java.util.Date(this.date.getTime());
	}

	/**
	 * Sets the creation date to a specific date.
	 * 
	 * @param myDate
	 *            A custom date.
	 * @see #getDate()
	 */
	public void setDate(Date myDate)
	{
		this.date = (myDate != null ? new java.util.Date(myDate.getTime()) : null);
	}

	/**
	 * Returns the message encoding.
	 * 
	 * @return The message encoding.
	 * @see #setEncoding(MessageEncodings)
	 * @see MessageEncodings
	 */
	public MessageEncodings getEncoding()
	{
		return this.encoding;
	}

	/**
	 * Returns the message Class.
	 * 
	 * @return The message class.
	 * @see #setDCSMessageClass
	 * @see MessageClasses
	 */
	public MessageClasses getDCSMessageClass()
	{
		return this.messageClass;
	}

	/**
	 * Sets the message Class to the specified one.
	 * 
	 * @param messageClass
	 *            The message Class.
	 * @see #getDCSMessageClass()
	 * @see MessageClasses
	 */
	public void setDCSMessageClass(MessageClasses messageClass)
	{
		this.messageClass = messageClass;
	}

	/**
	 * Returns the ID of the gateway which the message was received from (for
	 * inbound messages) or the message was dispatched from (outbound messages).
	 * 
	 * @return The Gateway ID.
	 * @see #setGatewayId(String)
	 */
	public String getGatewayId()
	{
		return this.gtwId;
	}

	/**
	 * Sets the message's Gateway ID to a specific value.
	 * 
	 * @param myGtwId
	 *            The Gateway ID.
	 * @see #getGatewayId()
	 */
	public void setGatewayId(String myGtwId)
	{
		this.gtwId = myGtwId;
	}

	/**
	 * Returns the message ID. This field can be used for your own purposes.
	 * 
	 * @return The message ID.
	 * @see #setId(String)
	 */
	public String getId()
	{
		return this.id;
	}

	/**
	 * Sets the message ID to a specific value.
	 * 
	 * @param myId
	 *            The new message ID.
	 * @see #getId()
	 */
	public void setId(String myId)
	{
		this.id = myId;
	}

	/**
	 * Returns the auto-generated, internal message ID.
	 * 
	 * @return The message ID.
	 */
	public long getMessageId()
	{
		return this.messageId;
	}

	/**
	 * Returns the message text.
	 * 
	 * @return The message text.
	 * @see #setText(String)
	 */
	public String getText()
	{
		return this.text;
	}

	/**
	 * Sets the message text.
	 * 
	 * @param myText
	 *            The message text.
	 * @see #getText()
	 */
	protected void setText(String myText)
	{
		this.text = myText;
	}

	public void addText(String addText) throws UnsupportedEncodingException
	{
		this.text += addText;
	}

	/**
	 * Returns the message type.
	 * 
	 * @return The message type.
	 * @see MessageTypes
	 * @see #setType(MessageTypes)
	 */
	public MessageTypes getType()
	{
		return this.type;
	}

	void setType(MessageTypes myType)
	{
		this.type = myType;
	}

	/**
	 * Returns the destination port of the message. Source and Destination ports
	 * are used when messages are targeting a midlet application. For standard
	 * SMS messages, the Source and Destination ports should <b>both</b> be set
	 * to -1 (which is their default value anyway).
	 * 
	 * @return The destination port.
	 * @see #getDstPort()
	 * @see #setSrcPort(int)
	 * @see #getSrcPort()
	 */
	public int getDstPort()
	{
		return this.dstPort;
	}

	/**
	 * Sets the destination port of the message. Source and Destination ports
	 * are used when messages are targeting a midlet application. For standard
	 * SMS messages, the Source and Destination ports should <b>both</b> be set
	 * to -1 (which is their default value anyway).
	 * <p>
	 * The default is (-1).
	 * 
	 * @param myDstPort
	 *            The destination port.
	 * @see #setDstPort(int)
	 * @see #setSrcPort(int)
	 * @see #getSrcPort()
	 */
	public void setDstPort(int myDstPort)
	{
		this.dstPort = myDstPort;
	}

	/**
	 * Returns the source port of the message. Source and Destination ports are
	 * used when messages are targeting a midlet application. For standard SMS
	 * messages, the Source and Destination ports should <b>both</b> be set to
	 * -1 (which is their default value anyway).
	 * 
	 * @return The source port.
	 * @see #setSrcPort(int)
	 * @see #setDstPort(int)
	 * @see #getDstPort()
	 */
	public int getSrcPort()
	{
		return this.srcPort;
	}

	/**
	 * Sets the source port of the message. Source and Destination ports are
	 * used when messages are targeting a midlet application. For standard SMS
	 * messages, the Source and Destination ports should <b>both</b> be set to
	 * -1 (which is their default value anyway).
	 * <p>
	 * The default is (-1).
	 * 
	 * @param mySrcPort
	 *            The source port.
	 * @see #setDstPort(int)
	 * @see #setSrcPort(int)
	 * @see #getSrcPort()
	 */
	public void setSrcPort(int mySrcPort)
	{
		this.srcPort = mySrcPort;
	}

	/**
	 * Sets the message encoding to the specified one.
	 * 
	 * @param myEncoding
	 *            The message encoding.
	 * @see #getEncoding()
	 * @see MessageEncodings
	 */
	public void setEncoding(MessageEncodings myEncoding)
	{
		this.encoding = myEncoding;
	}

	public abstract String getPduUserData();

	public abstract String getPduUserDataHeader();

	protected void copyTo(Message msg)
	{
		msg.setDate(getDate());
		msg.setEncoding(getEncoding());
		msg.setDCSMessageClass(getDCSMessageClass());
		msg.setId(getId());
		msg.setGatewayId(getGatewayId());
		msg.setSrcPort(getSrcPort());
		msg.setDstPort(getDstPort());
		msg.setType(getType());
		msg.setText(getText());
		msg.messageCharCount = this.messageCharCount;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高清视频一区二区| 久久青草国产手机看片福利盒子| 欧美日韩午夜影院| 亚洲国产精品成人综合| 舔着乳尖日韩一区| 99re这里只有精品视频首页| 精品欧美黑人一区二区三区| 一区二区在线看| 国产91丝袜在线播放| 欧美一区二区视频观看视频| 亚洲婷婷在线视频| 国产伦精一区二区三区| 91精品国产综合久久香蕉的特点| 亚洲黄网站在线观看| 成人精品国产一区二区4080| 欧美变态凌虐bdsm| av电影天堂一区二区在线观看| 日韩美女主播在线视频一区二区三区| 一区二区三区日韩精品| 成人黄色在线网站| 久久久久国色av免费看影院| 麻豆成人免费电影| 欧美一区永久视频免费观看| 亚洲一区二区中文在线| 色狠狠一区二区三区香蕉| 中文字幕一区二区三区不卡| 国产91精品精华液一区二区三区 | 精品国产乱码久久久久久蜜臀| 亚洲综合色在线| 91福利社在线观看| 一个色在线综合| 91官网在线免费观看| 一区二区三区国产精华| 欧美综合一区二区| 亚洲第一会所有码转帖| 欧美美女bb生活片| 日本不卡视频一二三区| 日韩欧美国产电影| 激情另类小说区图片区视频区| 精品国产免费人成在线观看| 国产一区91精品张津瑜| 国产日韩一级二级三级| 国产精品77777竹菊影视小说| 久久老女人爱爱| 国产不卡视频在线观看| 亚洲欧美国产77777| 欧美视频一区二区三区四区| 天天综合色天天综合色h| 欧美videofree性高清杂交| 国产成人在线免费| 亚洲精品水蜜桃| 欧美一区二区三区免费观看视频 | 亚洲色图.com| 欧美午夜精品电影| 蜜臂av日日欢夜夜爽一区| 亚洲精品一区二区三区福利| 国产精品正在播放| 亚洲免费视频成人| 欧美一区二区三区四区在线观看| 激情综合色播五月| 国产精品第13页| 欧美日韩一二三| 国产伦理精品不卡| 亚洲综合一区在线| 日韩欧美一区电影| 91网站黄www| 免费在线观看视频一区| 一区二区三区美女| 精品国产伦理网| 99久久精品国产网站| 视频在线观看一区| 国产精品久久毛片av大全日韩| 欧美日韩中文字幕一区| 国产在线视视频有精品| 亚洲色图第一区| 26uuu久久天堂性欧美| 在线亚洲精品福利网址导航| 久久99国产精品久久99果冻传媒 | 2023国产精品| 欧美视频一区二区三区| 成人avav影音| 精品一区二区三区久久久| 亚洲精品视频观看| 久久久99久久精品欧美| 欧美久久久久久蜜桃| av在线综合网| 国产中文字幕精品| 日韩专区欧美专区| 夜夜爽夜夜爽精品视频| 国产精品美女一区二区| 欧美成人性战久久| 3d动漫精品啪啪一区二区竹菊| 91视频免费播放| www.在线欧美| 国产精品一区在线观看你懂的| 日本视频一区二区三区| 一区二区三区在线视频免费| 国产精品日韩成人| 久久精品亚洲乱码伦伦中文| 91精品国产综合久久福利软件| 色吧成人激情小说| 97久久精品人人澡人人爽| 国产成人av资源| 国产精品一区免费在线观看| 免费人成在线不卡| 日本中文字幕不卡| 日韩影院在线观看| 亚洲电影在线播放| 亚洲综合免费观看高清完整版在线 | 成人aa视频在线观看| 国产一区二区日韩精品| 久久精品国产精品亚洲精品| 日韩av中文字幕一区二区三区| 亚洲第一成年网| 亚洲小说春色综合另类电影| 亚洲欧美一区二区三区久本道91 | 亚洲福利电影网| 亚洲一区二区av在线| 亚洲一二三区不卡| 亚洲chinese男男1069| 亚洲1区2区3区视频| 日韩高清在线一区| 精品一区二区日韩| 国产一区二区三区黄视频 | 亚洲一区二区三区视频在线 | 欧美性xxxxxx少妇| 欧美日本韩国一区| 欧美一区2区视频在线观看| 日韩欧美黄色影院| 久久久一区二区三区捆绑**| 久久免费看少妇高潮| 国产精品久久久久影视| 亚洲人成精品久久久久| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲欧美激情一区二区| 亚洲高清视频在线| 久久国产福利国产秒拍| 成人av电影观看| 欧美日韩一区三区四区| 精品捆绑美女sm三区| 日本一区二区成人| 亚洲一二三区在线观看| 美女久久久精品| av动漫一区二区| 中文字幕一区二区三区四区 | 国产在线精品视频| caoporm超碰国产精品| 欧美伦理电影网| 国产欧美日韩不卡免费| 亚洲一区视频在线| 国产乱人伦偷精品视频不卡| 色嗨嗨av一区二区三区| 精品国内片67194| 亚洲免费看黄网站| 经典三级一区二区| 在线免费观看日韩欧美| 久久综合色8888| 亚洲一区二区三区在线看| 国内精品国产成人| 91免费看`日韩一区二区| 欧美一卡在线观看| 亚洲另类色综合网站| 国产综合色精品一区二区三区| 99re66热这里只有精品3直播| 91精品国产免费久久综合| 国产精品久久精品日日| 日韩影院在线观看| 在线观看91精品国产入口| 精品久久久久久久一区二区蜜臀| 亚洲乱码一区二区三区在线观看| 久久99精品国产.久久久久久| 欧美影片第一页| 亚洲色图19p| 成人综合日日夜夜| 精品人伦一区二区色婷婷| 亚洲成人高清在线| 91国产视频在线观看| 国产精品你懂的在线| 精品一区二区日韩| 欧美一区二区在线播放| 亚洲综合精品久久| 91欧美一区二区| 中文文精品字幕一区二区| 久久超碰97人人做人人爱| 欧美精品 日韩| 亚洲第一综合色| 欧美综合一区二区三区| 夜夜操天天操亚洲| 91视频免费观看| 亚洲欧洲精品成人久久奇米网| 国产高清一区日本| 久久久久成人黄色影片| 久久99精品久久只有精品| 亚洲精品v日韩精品| 99在线热播精品免费| 国产精品天天看| 国产99久久久国产精品潘金| 久久久电影一区二区三区| 国产一区二区导航在线播放| 精品国产乱码久久久久久影片|