Startseite › Datentypen › H-Lib-Container Hilfe zum PBXB64-Compiler

H-Lib Multiset (Bag)

A multiset stores LONG keys together with their multiplicities (occurrence counts).

Kategorie: H-Lib-Container | Zertifizierung: [ZERTIFIZIERT GETESTET]

Beschreibung

A multiset stores LONG keys together with their multiplicities (occurrence counts).

Kind: Container | Category: H-Lib Native Containers

PBXB64 Status: AVAILABLE

PBXB64 Certification: [CERTIFIED TESTED]

Description

This H-Lib container is implemented in native C support code and exposed through PBXB64 BASIC container syntax. The examples below are focused usage patterns; keep handles valid, release each container with its Final method, and check counts or return values when a method can fail.

Methods

MethodSignatureReturnsDescription
Newm.NewLNMULTISETAllocate a new empty multiset.
Finalm.FinalnoneFree the multiset.
Validatem.ValidateLONGNon-zero if the handle is valid.
Clearm.ClearnoneRemove all keys.
Countm.CountLONGGesamtzahl aller gespeicherten Vorkommen.
Capacitym.CapacityQUADAktuelle Speicherkapazität.
Trimm.TrimnoneGibt ungenutzte Kapazität frei.
Clonem.CloneLNMULTISETGibt eine unabhängige Kopie zurück.
Addm.Add keynoneAdd one occurrence of a key.
Removem.Remove keynoneRemove one occurrence of a key.
RemoveAllm.RemoveAll keynoneRemove a key entirely.
Containsm.Contains keyLONGNon-zero if the key has any occurrence.
Multiplicitym.Multiplicity keyLONGGibt die Anzahl der Vorkommen eines Werts zurück.
Firstm.FirstQUADReturn the first distinct key (0 if empty).
Nextm.Next keyQUADReturn the next distinct key (0 if none).
Emptym.EmptyLONGNon-zero if the multiset is empty.
ToArraym.ToArrayLNARRReturn a new LNARR of distinct keys.

Validation Evidence

Validation evidence: H-Lib container behavior is exercised by registered BASIC container validation programs and the embedded H-Lib object set used by the single-EXE validation gate.

PBXB64-Prüfung

Diese Referenzseite soll durch ein fokussiertes Compile- oder Laufzeitbeispiel belegt sein. Das Beispiel soll Eingaben, erwartete Ausgabe oder Exit-Code und erforderliche Windows-Ressourcen oder Include-Dateien nennen.

Übersichtshinweise

Allgemeine Übersichtsseiten sollten trotzdem sagen, welche Familie gemeint ist, welche konkreten Befehlsseiten die Implementierung tragen und welche Formen nur der Navigation dienen. So bleibt die Seite detailliert genug, ohne so zu tun, als wäre sie eine vollständige Befehlsreferenz.

Beispiel

LOCAL m AS LNMULTISET
m = m.New
m.Add 5
m.Add 5
PRINT m.Multiplicity 5 ' 2
m.Final