📄 mmmessage.java
字号:
} /** * Clears all the receivers of the Multimedia Message. * */ public void clearTo() { hTo.clear(); flagToAvailable = false; } /** * Clears all the carbon copy receivers of the Multimedia Message. * */ public void clearCc() { hCc.clear(); flagCcAvailable = false; } /** * Clears all the blind carbon copy receivers of the Multimedia Message. * */ public void clearBcc() { hBcc.clear(); flagBccAvailable = false; } /** * Retrieve all the receivers of the Multimedia Message. * * return a vector of MMAddress objects. * */ public Vector getTo() { return hTo; } /** * Retrieve all the CC receivers of the Multimedia Message. * * return a vector of MMAddress objects. * */ public Vector getCc() { return hCc; } /** * Retrieve all the BCC receivers of the Multimedia Message. * * return a vector of MMAddress objects. * */ public Vector getBcc() { return hBcc; } /** * Retrieves the arrival time of the message at the MMS Proxy-Relay (Optional). * MMS Proxy-Relay will generate this field when not supplied by terminal. * * return the arrival date. * */ public Date getDate() { return hReceivedDate; } /** * Sets the sending time of the message at the MMS Proxy-Relay (Optional). * * param value the date. * */ public void setDate(Date value) { hReceivedDate = value; flagDateAvailable=true; } /** * Retrieves the address of the message sender (Mandatory). * * return the address. * */ public MMAddress getFrom() { return hFrom; } /** * Sets the address of the message sender (Mandatory). * * param value is the string representing the address of the sender. It has * to be specified in the full format i.e.: +358990000005/TYPE=PLMN or * joe@user.org or 1.2.3.4/TYPE=IPv4. * */ public void setFrom(String value) { hFrom = new MMAddress( decodeAddress(value) ); flagFromAvailable=true; } /** * Retrieves the subject of the Multimedia Message (Optional). * * return the subject. * */ public String getSubject() { return hSubject; } /** * Sets the subject of the Multimedia Message (Optional). * * param value the subject. * */ public void setSubject(String value) { hSubject = new String(value); flagSubjectAvailable=true; } /** * Retrieves the message class of the Multimedia Message (Optional). * * return One of the following values: * MESSAGE_CLASS_PERSONAL, MESSAGE_CLASS_ADVERTISEMENT, * MESSAGE_CLASS_INFORMATIONAL, MESSAGE_CLASS_AUTO * */ public byte getMessageClass() { return hMessageClass; } /** * Sets the message class of the Multimedia Message (Optional). * * param value is the message class. It can have one of the following values: * MESSAGE_CLASS_PERSONAL, MESSAGE_CLASS_ADVERTISEMENT, * MESSAGE_CLASS_INFORMATIONAL, MESSAGE_CLASS_AUTO * */ public void setMessageClass(byte value) { hMessageClass = value; flagMessageClassAvailable = true; } /** * Retrieves the content type of the Multimedia Message (Mandatory). * * return the content type. */ public String getContentType() { return hContentType; } /** * Sets the content type of the Multimedia Message (Mandatory). * * param value is the content type. The standard for interoperability supports * one of the following values: * CT_APPLICATION_MULTIPART_MIXED, CT_APPLICATION_MULTIPART_RELATED * */ public void setContentType(String value) { hContentType = new String( value ); flagContentTypeAvailable = true; } /** * Retrieves the number of contents of of the Multimedia Message (Mandatory). * * return the number of contents. */ public int getNumContents() { return tableOfContents.size(); } /** * Sets the content ID of the content containing the presentation part of the * Multimedia Message (Mandatory when the content type of the Multimedia Message is CT_APPLICATION_MULTIPART_RELATED). * * param value is the content ID. * */ public void setPresentationId(String value) { presentationId = value; } /** * Sets the type of the presentation part.(Mandatory when the content type of the Multimedia Message is CT_APPLICATION_MULTIPART_RELATED). * * param value the type of the presentation part. The standard for interoperability supports * only the value: CT_APPLICATION_SMIL * */ public void setMultipartRelatedType(String value) { flagMultipartRelated = true; multipartRelatedType = value; } /** * Retrieves the type of the presentation part. * * return the type of the presentation part. */ public String getMultipartRelatedType() { if (flagMultipartRelated) { return multipartRelatedType; } else return null; } /** * Adds a content to the message. * * param mmc is the content to add. * */ public void addContent(MMContent mmc) { tableOfContents.put(mmc.getContentId(),mmc); } /** * Retrieves the content referring to the presentation part. * * return the presentation content. */ public MMContent getPresentation() { if ((flagMultipartRelated==true) && (getNumContents()>0)) return (MMContent) tableOfContents.get(presentationId); else return null; } /** * Retrieves the content ID referring to the presentation part. * * return the content ID. */ public String getPresentationId() { if ((flagMultipartRelated==true) && (getNumContents()>0)) return presentationId; else return null; } /** * Retrieves the content having the specified id. * * return the content. * param id is the id of the content to be retrieved. */ public MMContent getContent(String id) { return (MMContent) tableOfContents.get(id); } /** * Retrieves the content at the position index. * * return the content. * param index is the index of the content to be retrieved. */ public MMContent getContent(int index) { MMContent value=null; int j=0; for (Enumeration e = tableOfContents.elements() ; (e.hasMoreElements() && j<=index) ;j++) { value=(MMContent)e.nextElement(); } return value; } /** * Retrieves the expiry date of the message (Optional). * * return the expiry date/time. */ public Date getExpiry() { return hExpiry; } /** * Sets the length of time the message will be stored in the MMS Proxy-Relay * or time to delete the message (Optional). This field can have two format, * either absolute or interval depending on how it is set with the method * setExpiryAbsolute(). * * param value is the expiry date/time. */ public void setExpiry(Date value) { hExpiry = value; flagExpiryAvailable = true; } /** * Sets the format of the expiry date/time. * * param value if true the expiry date is absolute, else is * intended as an interval. */ public void setExpiryAbsolute (boolean value) { flagExpiryAbsolute = value; } /** * Returns information about the format of the expiry date/time. * * return true if the expiry date/time is absolute, * false if it is intended as an interval. */ public boolean isExpiryAbsolute() { return flagExpiryAbsolute; } /** * Retrieves the delivery-report flag (Optional). * * return true if the user wants the delivery report. */ public boolean getDeliveryReport() { return hDeliveryReport; } /** * Retrieves the sender-visibility flag (Optional). * * return 0x80 if the user wants the sender visibility setting to Hide. * 0x81 if the user wants the sender visibility setting to Show. */ public byte getSenderVisibility() { return hSenderVisibility; } /** * Retrieves the read reply flag (Optional). * * return true if the user wants the read reply. */ public boolean getReadReply() { return hReadReply; } /** * Retrieves the delivery date/time of the message (Optional). * * return the delivery date/time. */ public Date getDeliveryTime() { return hDeliveryTime; } /** * Specify whether the user wants a delivery report from each recipient (Optional). * * param value true if the user wants the delivery report. */ public void setDeliveryReport(boolean value) { hDeliveryReport = value; flagDeliveryReportAvailable = true; } /** * Specify whether the user wants sender visibility (Optional). * * return 0x80 if the user wants the sender visibility setting to Hide. * 0x81 if the user wants the sender visibility setting to Show. */ public void setSenderVisibility(byte value) { hSenderVisibility = value; flagSenderVisibilityAvailable = true; } /** * Specify whether the user wants a read report from each recipient as a new message(Optional). * * param value true if the user wants the read report. */ public void setReadReply(boolean value) { hReadReply = value; flagReadReplyAvailable = true; } /** * Sets the date/time of the desired delivery(Optional). * Indicates the earliest possible delivery of the message to the recipient. * This field can have two format, * either absolute or interval depending on how it is set with the method * setDeliveryTimeAbsolute(). * * param value the delivery date/time. */ public void setDeliveryTime(Date value) { hDeliveryTime = value; flagDeliveryTimeAvailable = true; } /** * Sets the format of the delivery date/time. * * param value if true the delivery date/time is absolute, else is * intended as an interval. */ public void setDeliveryTimeAbsolute (boolean value) { flagDeliveryTimeAbsolute = value; } /** * Returns information about the format of the delivery date/time. * * return true if the delivery date/time is absolute, * false if it is intended as an interval. */ public boolean isDeliveryTimeAbsolute() { return flagDeliveryTimeAbsolute; } /** * Retrieves the priority of the message for the recipient (Optional). * * return the priority. It can be one of the following the values: * PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_HIGH * */ public byte getPriority() { return hPriority; } /** * Sets the priority of the message for the recipient (Optional). * * param value One of the following the values: * PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_HIGH * */ public void setPriority(byte value) { hPriority = value; flagPriorityAvailable = true; } public MMMessage() { tableOfContents = new Hashtable(); hTo = new Vector(); hCc = new Vector(); hBcc = new Vector(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -