INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Collections of items, where each item may occur zero ", "or more times, and the number of occurrences is meaningful. "
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
key: bag, access
cluster: eiffelbase
deferred class BAG [G]
inherit

COLLECTION [G]
redefine
extend
end
feature -- Measurement

occurrences (v: G): INTEGER
-- Number of times `v' appears in structure
-- (Reference or object equality,
-- based on `object_comparison'.)
ensure
non_negative_occurrences: Result >= 0
feature -- Element change

extend (v: G)
-- Add a new occurrence of `v'.
ensure
one_more_occurrence: occurrences (v) = (occurrences (v)) + 1
end -- class BAG

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES