Skip to content

GLib.SequenceIter

record (struct)

The SequenceIter struct is an opaque data type representing an iterator pointing into a Sequence.

Methods

compare

def compare(self, b: SequenceIter) -> int

Returns a negative number if a comes before b, 0 if they are equal, and a positive number if a comes after b.

The a and b iterators must point into the same sequence.

Parameters:

get_position

def get_position(self) -> int

Returns the position of iter

get_sequence

def get_sequence(self) -> Sequence

Returns the Sequence that iter points into.

is_begin

def is_begin(self) -> bool

Returns whether iter is the begin iterator

is_end

def is_end(self) -> bool

Returns whether iter is the end iterator

move

def move(self, delta: int) -> SequenceIter

Returns the SequenceIter which is delta positions away from iter. If iter is closer than -delta positions to the beginning of the sequence, the begin iterator is returned. If iter is closer than delta positions to the end of the sequence, the end iterator is returned.

Parameters:

  • delta — A positive or negative number indicating how many positions away from iter the returned SequenceIter will be

next

def next(self) -> SequenceIter

Returns an iterator pointing to the next position after iter. If iter is the end iterator, the end iterator is returned.

prev

def prev(self) -> SequenceIter

Returns an iterator pointing to the previous position before iter. If iter is the begin iterator, the begin iterator is returned.