NAME

Graphics::Grid::UnitList - List of UnitLikes

VERSION

version 0.001

SYNOPSIS

use Graphics::Grid::UnitList;
my $ul1 = Graphics::Grid::UnitList->new($u1, $u2, ...);

DESCRIPTION

You would mostly never directly use this class. Usually you could get a UnitList object by the append method.

# at least one of $u1 and $u2 is a UnitArithmetic object
my $ul2 = $u1->append($u2);

METHODS

elems

Number of effective values in the object.

length

This is an alias of elems().

at($idx)

slice($indices)

Slice by indices.

string()

Returns a string representing the object.

sum()

Sum the effective unit vector in a unit object.

append($other)

Append two UnitLike objects. If both are Graphics::Grid::Unit objects, this method would return a Graphics::Grid::Unit object. Otherwise, it would return a Graphics::Grid::UnitList object.

insert($other, $after=$self->elems-1)

Insert another UnitLike object after index $after. Insert before first element if after is a negative value.

SEE ALSO

Graphics::Grid

Graphics::Grid::UnitLike

AUTHOR

Stephan Loyd <sloyd@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018-2023 by Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.