Plucen...vector(3pm)

πŸ“¦
version 1.25 Β· 2 versions
  • 1.25 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.25 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Plucene::Bitvector β€” a vector of bits ✨

ok so bestie, welcome to Plucene::Bitvector πŸ’– this is one of those little perl manpages that ships with User Contributed Perl Documentation, and honestly? it's short, it's sweet, and it does exactly one thing. let's get into it 🫢


🌸 NAME 🌸

Plucene::Bitvector β€” a vector of bits πŸ’…

like. that's it. that's the whole vibe. a vector. of bits. iconic.


✨ SYNOPSIS ✨

# isa Bit::Vector::Minimal;

my $bitvector = Plucene::Bitvector->read($stream);

$bitvector->write($stream);

my $count = $bitvector->count;

see how the very first line is a comment saying it's a Bit::Vector::Minimal? yeah that's not a suggestion, that's the whole personality. read it, write it, count it. slay. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so Plucene::Bitvector is a serialisable implementation of a vector of bits. no cap.

and here's the tea β˜• β€” it's a subclass of Bit::Vector::Minimal, which is what gives it the power to write vectors to a Plucene stream and read them back from one. so basically: bits go in, bits come out, and they survive the trip through a stream. the way that it just… serialises? obsessed. πŸŽ€


πŸ’– METHODS πŸ’–

🌟 count

my $count = $bitvector->count;

computes the number of one-bits. that's it. it counts the ones. it does not count the zeros, it does not count your problems, it counts the 1s. periodt. πŸ’…

🌟 write

$bitvector->write($stream);

writes this vector out to the stream you passed in. hand it a stream, it hands back your bits. 🫢

🌟 read

my $bitvector = Plucene::Bitvector->read($stream);

reads from the stream you passed in. give it a stream, it gives you a bitvector. main character energy fr fr. 😭✨


lowkey reminder: this is a subclass of Bit::Vector::Minimal, so all that base-class behaviour is coming along for the ride. you didn't think it was just vibes, did you? πŸ‘‘

πŸ’œ SIGN-OFF πŸ’œ

and that's the whole page, bestie β€” no more methods, no more secrets, we ate and left no crumbs πŸ“

this little gem comes to you from perl v5.36.0, dated 2022-12-04, filed under Plucen...vector(3pm) in the user contributed perl documentation section. go forth and count your one-bits, you absolute legend πŸŒˆβ­πŸ‘‘

πŸ“¦ where this page comes from