当前位置: 首页>>代码示例>>Java>>正文


Java SearchTerm.match方法代码示例

本文整理汇总了Java中javax.mail.search.SearchTerm.match方法的典型用法代码示例。如果您正苦于以下问题:Java SearchTerm.match方法的具体用法?Java SearchTerm.match怎么用?Java SearchTerm.match使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.mail.search.SearchTerm的用法示例。


在下文中一共展示了SearchTerm.match方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: searchInternal

import javax.mail.search.SearchTerm; //导入方法依赖的package包/类
@Override
protected long[] searchInternal(SearchTerm searchTerm)
{
    List<SimpleStoredMessage> messages = getMessages();
    long[] result = new long[messages.size()];
    int i = 0;
    
    for (SimpleStoredMessage message : messages)
    {
        if (searchTerm.match(message.getMimeMessage()))
        {
            result[i] = message.getUid();
            i++;
        }
    }
    return Arrays.copyOfRange(result, 0, i);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AlfrescoImapFolder.java

示例2: search

import javax.mail.search.SearchTerm; //导入方法依赖的package包/类
public long[] search(SearchTerm searchTerm) {
    ArrayList matchedMessages = new ArrayList();

    for (int i = 0; i < mailMessages.size(); i++) {
        SimpleStoredMessage message = (SimpleStoredMessage) mailMessages.get(i);
        if (searchTerm.match(message.getMimeMessage())) {
            matchedMessages.add(message);
        }
    }

    long[] matchedUids = new long[matchedMessages.size()];
    for (int i = 0; i < matchedUids.length; i++) {
        SimpleStoredMessage storedMessage = (SimpleStoredMessage) matchedMessages.get(i);
        long uid = storedMessage.getUid();
        matchedUids[i] = uid;
    }
    return matchedUids;
}
 
开发者ID:Alfresco,项目名称:alfresco-greenmail,代码行数:19,代码来源:InMemoryStore.java

示例3: search

import javax.mail.search.SearchTerm; //导入方法依赖的package包/类
public Message[] search(final SearchTerm term, final Message[] msgsToSearch) {
    final List<MockMessage> sms = new ArrayList<MockMessage>();
    final List<Message> msgsToSearchL = new ArrayList<Message>();

    if (msgsToSearch != null) {
        msgsToSearchL.addAll(Arrays.asList(msgsToSearch));
    }

    for (final Message msg : getMessages()) {
        if (term != null && term.match(msg)) {

            if (msgsToSearch == null || msgsToSearchL.contains(msg)) {
                sms.add((MockMessage) msg);
            }
        }
    }
    return sms.toArray(new Message[sms.size()]);
}
 
开发者ID:salyh,项目名称:javamail-mock2,代码行数:19,代码来源:MailboxFolder.java

示例4: search

import javax.mail.search.SearchTerm; //导入方法依赖的package包/类
@Override
public long[] search(SearchTerm searchTerm) {
    List<StoredMessage> matchedMessages = new ArrayList<>();

    synchronized (mailMessages) {
        for (int i = 0; i<mailMessages.size();i++) {
            StoredMessage mailMessage = mailMessages.get(i);
            // Update message sequence number for potential sequence set search
            // https://tools.ietf.org/html/rfc3501#page-10
            mailMessage.updateMessageNumber(i+1);
            if (searchTerm.match(mailMessage.getMimeMessage())) {
                matchedMessages.add(mailMessage);
            }
        }
    }

    long[] matchedUids = new long[matchedMessages.size()];
    for (int i = 0; i < matchedUids.length; i++) {
        StoredMessage storedMessage = matchedMessages.get(i);
        long uid = storedMessage.getUid();
        matchedUids[i] = uid;
    }
    return matchedUids;
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:25,代码来源:HierarchicalFolder.java


注:本文中的javax.mail.search.SearchTerm.match方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。