DateTime::Event::Cron::Quartz::TreeSet - Ordered, unique set implementation.
This TreeSet implementation is a part of the DateTime::Event::Cron::Quartz distribution.
use DateTime::Event::Cron::Quartz::TreeSet; # TreeSet construction my $set = DateTime::Event::Cron::Quartz::TreeSet->new; # TreeSet constuction from the list of numeric values my $set = DateTime::Event::Cron::Quartz::TreeSet->new([30, 28, 15]); # adding an element to existing treeset $set->add(20); # getting last element from the set (greatest in the set) my $last = $set->last_item(); # getting the first element from the set (lowest one) my $first = $set->first_item(); # getting the set size my $size = $set->size(); # getting the portion of the set whose elements are greater than or equal # to the parameter value my $tail_set = $set->tail_set(15); # check if the set contains an element if ($set->contains(40)) { print "set contains element with value of 40\n"; }
This package implements the set. This package guarantees that the sorted set will be in ascending element order. Elements in this set are unique. Package provides some functionality from http://java.sun.com/j2se/1.4.2/docs/api/java/util/TreeSet.html
Returns a DateTime::Event::Cron::Quartz::TreeSet object which contains the list of values if $list parameter was provided
Returns the number of elements in this set (its cardinality).
Returns the first (lowest) element currently in this sorted set.
Returns the last (gratest) element currently in this sorted set.
Returns true if this set contains the specified element.
Returns a view of the portion of this set whose elements are greater than or equal to $from_element. The returned sorted set supports all TreeSet methods.
Returns an ordered array of elements
TreeSet works only with numbers. strings/objects are not allowed
This is not a complete implementation of TreeSet. Only basic functionality used by DateTime::Event::Cron::Quartz provided. Can not be used separately.
Vadim Loginov <vadim.loginov@gmail.com>
Based on the source code and documentation of OpenSymphony http://www.opensymphony.com/team.jsp Quartz 1.4.2 project licensed under the Apache License, Version 2.0
Copyright (c) 2009 Vadim Loginov.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
0.05
DateTime::Event::Cron::Quartz(3), http://java.sun.com/j2se/1.4.2/docs/api/java/util/TreeSet.html
To install DateTime::Event::Cron::Quartz, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DateTime::Event::Cron::Quartz
CPAN shell
perl -MCPAN -e shell install DateTime::Event::Cron::Quartz
For more information on module installation, please visit the detailed CPAN module installation guide.