com.hs.mail.imap.mailbox
Class UidToMsnMapper

java.lang.Object
  extended by com.hs.mail.imap.mailbox.UidToMsnMapper

public class UidToMsnMapper
extends Object

Convert Unique Identifier (UID) to Message Sequence Number (MSN) and vice versa.

Since:
Mar 22, 2010
Author:
Won Chul Doh

Field Summary
protected  SelectedMailbox selected
           
protected  List<Long> uids
           
protected  boolean useUID
           
 
Constructor Summary
UidToMsnMapper(SelectedMailbox selected, boolean useUID)
           
UidToMsnMapper(SelectedMailbox selected, List<Long> uids, boolean useUID)
           
 
Method Summary
 long getMaxMessageNumber(long max)
          Find the largest message sequence number whose corresponding unique identifier is equal or less than the given unique identifier.
 int getMessageNumber(long uid)
           
 long getMinMessageNumber(long min)
          Find the smallest message sequence number whose corresponding unique identifier is equal or greater than the given unique identifier.
 long getUID(int msgnum)
           
 List<Long> getUIDList()
           
protected  int search(List<Long> v, long t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selected

protected SelectedMailbox selected

uids

protected List<Long> uids

useUID

protected boolean useUID
Constructor Detail

UidToMsnMapper

public UidToMsnMapper(SelectedMailbox selected,
                      List<Long> uids,
                      boolean useUID)

UidToMsnMapper

public UidToMsnMapper(SelectedMailbox selected,
                      boolean useUID)
Method Detail

getUID

public long getUID(int msgnum)

getMessageNumber

public int getMessageNumber(long uid)

getUIDList

public List<Long> getUIDList()

getMinMessageNumber

public long getMinMessageNumber(long min)
Find the smallest message sequence number whose corresponding unique identifier is equal or greater than the given unique identifier.

Parameters:
min - the key UID to be searched for
Returns:
the smallest message sequence number if found; otherwise -1

getMaxMessageNumber

public long getMaxMessageNumber(long max)
Find the largest message sequence number whose corresponding unique identifier is equal or less than the given unique identifier.

Parameters:
max - the key UID to be searched for
Returns:
the largest message sequence number if found; otherwise -1

search

protected int search(List<Long> v,
                     long t)


Copyright © 2011. All Rights Reserved.