javax.mail.search
public final class: MessageIDTerm [javadoc |
source]
java.lang.Object
javax.mail.search.SearchTerm
javax.mail.search.StringTerm
javax.mail.search.MessageIDTerm
All Implemented Interfaces:
Serializable
This term models the RFC822 "MessageId" - a message-id for
Internet messages that is supposed to be unique per message.
Clients can use this term to search a folder for a message given
its MessageId.
The MessageId is represented as a String.
- author:
Bill
- Shannon
- author:
John
- Mani
Constructor: |
public MessageIDTerm(String msgid) {
// Note: comparison is case-insensitive
super(msgid);
}
Parameters:
msgid - the msgid to search for
|
Method from javax.mail.search.MessageIDTerm Summary: |
---|
equals, match |
Methods from javax.mail.search.SearchTerm: |
---|
match |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.mail.search.MessageIDTerm Detail: |
public boolean equals(Object obj) {
if (!(obj instanceof MessageIDTerm))
return false;
return super.equals(obj);
}
|
public boolean match(Message msg) {
String[] s;
try {
s = msg.getHeader("Message-ID");
} catch (Exception e) {
return false;
}
if (s == null)
return false;
for (int i=0; i < s.length; i++)
if (super.match(s[i]))
return true;
return false;
}
|