NAME

Iterator::Flex::Cache - Cache Iterator Class

VERSION

version 0.18

METHODS

new

$iterator = Iterator::Flex::Cache->new( $iterable, ?\%pars );

The iterator caches values of $iterable (by default, the previous and current values),

$iterable is converted into an iterator via "to_iterator" in Iterator::Flex::Factory if required.

The optional %pars hash may contain standard signal parameters as well as the following model parameters:

capacity => integer

The size of the cache. It defaults to 2.

The returned iterator supports the following capabilities:

current
next
prev
rewind
reset
freeze

at

$value = $iter->at( $idx );

Returns the cache value at $idx. The most recent value is at $idx = 0, and the last value is at $idx = $capacity - 1.

INTERNALS

SUPPORT

Bugs

Please report any bugs or feature requests to bug-iterator-flex@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Iterator-Flex

Source

Source is available at

https://gitlab.com/djerius/iterator-flex

and may be cloned from

https://gitlab.com/djerius/iterator-flex.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007