NAME

MYDan::Node::KeySet - KeySet implementation

SYNOPSIS

use MYDan::Node::KeySet;

my @a = qw( foo foo1 bar1 baz1 );
my $a = MYDan::Node::KeySet->new()->load( \@a );

my %b = ( foo => 1, foo2 => 1, bar2 => 1, baz2 => 1 );
my $b = $a->new()->load( \%b );

my $c = $a->new()->load( 'foo1', 'foo3' );
my $d = $a->new()->load( $c );

$a->add( $b );
$b->subtract( qr/foo/ );
$c->intersect( \%b );

print $a->dump( range => '..' ), "\n";

SYMBOLS

range : '~' list : ',' null : '$'

DATA METHODS

get( $o )

Returns a list of elements of a supported object.

load( $o, %symbol )

Loads from a supported object, or a pair of delimiting elements that indicate a contiguous range. Symbols may be redefined in %symbol.

dump( %symbol )

Serializes to a range expression. Symbols may be redefined in %symbol.

list()

Returns a list of elements.

has( $element )

Determines if object contains element.

ARITHMETIC METHODS

( These methods modify the invoking object. )

add( $o )

Adds a supported object to object.

subtract( $o )

Subtracts a supported object from object.

intersect( $o )

Intersects with a supported object.

symdiff( $o )

Takes symmetric difference with a supported object.

multiply( $o )

X with a supported object.

SUPPORTED OBJECTS

ARRAY, HASH, another object, and for arithmetic methods, Regexp.