NAME IdSetWithCount

Class encapsulating a set of DBMDatabase::Id and an integer count for the number of such things within the set.

This package is part of the DBMDatabase manpage. For more information on the database see the DBMDatabase::Overview.

Copyright &copy 1997 Curtis E. Dyreson. All rights reserved. Please be aware of the DBMDatabase::Licence and DBMDatabase::Version.


DESCRIPTION

An IdSetWithCount is a data type for columns in a database DBMDatabase::Table. An IdSetWithCount cannot be used as a key.


METHODS


new(Id[] \@ids)

Construct a Set from a list of Ids


fromBytes(string $b)

Construct a new IdSetWithCount from a byte image of an DBMDatabase::IdList or IdSetWithCount.

Construct a new IdSetWithCount from an DBMDatabase::IdList (basically, convert the list to a set).


numberOfElements()

Return the number of Ids in the set.


memberOf(Id $id)

Returns true if it is, false otherwise.


delete(Id $id)

Delete an Id from the set.


insert(Id $id)

Inserts an DBMDatabase::Id into this set.


insertWithCount(Id $id, int $count)

Inserts an DBMDatabase::Id into this set with the indicated count. Careful, it overwrites existing count for element!


enumerate()

Return an enumeration of the IdSetWithCount. OK, we have to fake it in Perl since this is a Java concept (although now that I understand hash tables I think I can do it with each). So we will return the list of values in the table. Currently, only small sets should be enumerated.


enumerateInSortedOrder()

Return an enumeration of the IdSetWithCount. OK, we have to fake it in Perl since this is a Java concept (although now that I understand hash tables I think I can do it with each). So we will return the list of values in the table. Currently, only small sets should be enumerated. We do this by sorting the list prior to enumerating it.


union(IdSetWithCount $other)

Union this set with the other set, and update this set with the result.


unionSelf(IdSetWithCount $other)

Union this set with the other set, and update this set with the result.


intersect(IdSetWithCount $other)

Intersect this set with the other set, and return the result.


intersectSelf(IdSetWithCount $other)

Intersect this set with the other set, and update this set with the result.


toIdArrayReference()

Returns a reference to an array of Ids from the Set. Replicates an id for each count.


image()

Create a formatted string of all the elements in the set


toBytes()

Convert to a byte array


import()

Is this still needed? Just for requires.