NAME
Zing::Cursor - Lookup Table Traversal
ABSTRACT
Lookup Table Traversal Construct
SYNOPSIS
use Zing::Lookup;
use Zing::Cursor;
my $lookup = Zing::Lookup->new(name => 'users');
$lookup->set('user-12345')->set(username => 'u12345');
$lookup->set('user-12346')->set(username => 'u12346');
$lookup->set('user-12347')->set(username => 'u12347');
my $cursor = Zing::Cursor->new(lookup => $lookup);
# $cursor->count;
DESCRIPTION
This package provides a cursor for traversing Zing::Lookup indices and supports forward and backwards traversal as well as token-based pagination.
LIBRARIES
This package uses type constraints from:
ATTRIBUTES
This package has the following attributes:
lookup
lookup(Lookup)
This attribute is read-only, accepts (Lookup)
values, and is required.
position
position(Maybe[Str])
This attribute is read-write, accepts (Maybe[Str])
values, and is optional.
METHODS
This package implements the following methods:
count
count() : Int
The count method returns the number of Zing::Domain objects in the lookup table.
fetch
fetch(Int $size = 1) : ArrayRef[Domain]
The fetch method returns the next n
Zing::Domain objects from the lookup table.
first
first() : Maybe[Domain]
The first method returns the first Zing::Domain object created in the lookup table.
last
last() : Maybe[Domain]
The last method returns the last Zing::Domain object created in the lookup table.
next
next() : Maybe[Domain]
The next method returns the next (after the current position) Zing::Domain object in the lookup table.
prev
prev() : Maybe[Domain]
The prev method returns the prev (before the current position) Zing::Domain object in the lookup table.
reset
reset() : Cursor
The reset method returns the cursor to its starting position (defined at construction).
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".