MessageSequence class

Defines a list of message IDs.

IDs can be either be based on sequence IDs or on UIDs.

Annotations
  • @JsonSerializable()

Constructors

MessageSequence({bool isUidSequence = false})
Creates a new message sequence.
MessageSequence.fromAll()
Convenience method for getting the sequence for all messages.
MessageSequence.fromId(int id, {bool isUid = false})
Convenience method for getting the sequence for a single id.
MessageSequence.fromIds(List<int> ids, {bool isUid = false})
Convenience method to creating a sequence from a list of ids.
MessageSequence.fromJson(Map<String, dynamic> json)
Creates a MessageSequence from the given json
factory
MessageSequence.fromLast()
Convenience method for getting the sequence for the last message.
MessageSequence.fromMessage(MimeMessage message)
Convenience method for getting the sequence for a single message's UID or sequence ID.
MessageSequence.fromMessages(List<MimeMessage> messages)
Convenience method for getting the sequence for the given messages's UIDs or sequence IDs.
MessageSequence.fromPage(int page, int pageSize, int messagesExist, {bool isUidSequence = false})
Convenience method for getting the sequence for a range defined by the page starting with 1, the pageSize and the number of messages messagesExist.
factory
MessageSequence.fromRange(int start, int end, {bool isUidSequence = false})
Convenience method for getting the sequence for a single range from start to end inclusive.
MessageSequence.fromRangeToLast(int start, {bool isUidSequence = false})
Convenience method for getting the sequence for a single range from start to the last message inclusive.
MessageSequence.fromSequenceId(MimeMessage message)
Convenience method for getting the sequence for a single message.
MessageSequence.fromUid(MimeMessage message)
Convenience method for getting the sequence for a single message's UID.
MessageSequence.parse(String text, {bool isUidSequence = false})
Generates a sequence based on the specified input text like 1:10,21,73:79.

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Checks is this sequence has at no elements.
no setter
isNil bool
Is this a null sequence?
no setter
isNotEmpty bool
Checks is this sequence has at least one element.
no setter
isUidSequence bool
True when this sequence is consisting of UIDs
final
length int
The length of this sequence.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(int id) → void
Adds the specified id
addAll() → void
Adds all messages
addLast() → void
Adds the last element, which is alway *.
addList(List<int> ids) → void
Adds a user defined sequence of IDs
addMessage(MimeMessage message) → void
Adds the UID or sequence ID of the message to this sequence.
addRange(int start, int end) → void
Adds all messages between start and end inclusive.
addRangeToLast(int start) → void
Adds a range from the specified start ID to to the last * element.
addSequenceId(MimeMessage message) → void
Adds the sequence ID of the specified message.
addUid(MimeMessage message) → void
Adds the UID of the specified message.
containsLast() bool
Checks if this sequence contains the last indicator in some form - '*'
elementAt(int index) int
Retrieves the ID at the specified zero-based index.
every() Iterable<int>
Iterates through the sequence
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(int id) → void
Removes the given id
removeMessage(MimeMessage message) → void
Removes the UID or sequence ID of the message to this sequence.
removeSequenceId(MimeMessage message) → void
Removes the sequence ID of the specified message.
removeUid(MimeMessage message) → void
Removes the UID of the specified message.
render(StringBuffer buffer) → void
Renders this message sequence into the specified StringBuffer buffer.
sort() → void
Sorts the sequence set.
subsequence(int start, [int? end]) MessageSequence
Creates a new sequence containing the message IDs/UIDs between start (inclusive) and end (exclusive)
subsequenceFromPage(int pageNumber, int pageSize, {int skip = 0}) MessageSequence
Retrieves sequence containing the message IDs/UIDs from the page with the given pageNumber which starts at 1 and the given pageSize.
toJson() Map<String, dynamic>
Converts this MessageSequence to JSON
toList([int? exists]) List<int>
Lists all entries of this sequence.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) int
Retrieves the ID at the specified zero-based index.