Modifier and Type | Class and Description |
---|---|
static class |
MessageRange.Type |
Modifier and Type | Field and Description |
---|---|
static long |
MAX_UID |
static long |
NOT_A_UID |
Modifier | Constructor and Description |
---|---|
protected |
MessageRange(MessageRange.Type type,
long uidFrom,
long uidTo) |
Modifier and Type | Method and Description |
---|---|
static MessageRange |
all()
Constructs a range consisting of all messages.
|
static MessageRange |
from(long from)
Constructs an inclusive, open ended range of messages.
|
MessageRange.Type |
getType() |
long |
getUidFrom() |
long |
getUidTo() |
boolean |
includes(long uid)
Return true if the uid is within the range
|
Iterator<Long> |
iterator()
Return a read-only
Iterator which contains all uid which fail in the specified range. |
static MessageRange |
one(long uid)
Constructs a range consisting of a single message only.
|
static MessageRange |
range(long from,
long to)
Constructs an inclusive ranges of messages.
|
List<MessageRange> |
split(int maxItems)
Tries to split the given
MessageRange to a List of MessageRange 's which
select only a max amount of items. |
static List<MessageRange> |
toRanges(Collection<Long> uidsCol)
|
String |
toString() |
public static final long NOT_A_UID
public static final long MAX_UID
protected MessageRange(MessageRange.Type type, long uidFrom, long uidTo)
public static MessageRange one(long uid)
uid
- UID of the messagepublic static MessageRange all()
public static MessageRange range(long from, long to)
from(long)
used where appropriate.from
- first message UIDto
- last message UIDpublic static MessageRange from(long from)
from
- first message UID in rangepublic MessageRange.Type getType()
public long getUidFrom()
public long getUidTo()
public boolean includes(long uid)
uid
- public static List<MessageRange> toRanges(Collection<Long> uidsCol)
uidsCol
- collection of uids to convertpublic Iterator<Long> iterator()
Iterator
which contains all uid which fail in the specified range.public List<MessageRange> split(int maxItems)
MessageRange
to a List
of MessageRange
's which
select only a max amount of items. This only work for MessageRange
's with MessageRange.Type
of
MessageRange.Type.RANGE
.maxItems
- Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.