This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

EiffelBase class
(HTML page generated by ISE Eiffel 4.2)

Eiffel Class
indexing
	description: "Collections of items, where each item may occur zero or more times, and the number of occurrences is meaningful.";
	status: "See notice at end of class";
	names: bag, access;
	access: membership;
	contents: generic;
	date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
	revision: "$Revision: 95354 $"

deferred class BAG [G]

inherit
	COLLECTION [G]
		redefine
			extend
		end

feature -- Measurement

	occurrences (v: G): INTEGER is
			-- Number of times v appears in structure
			-- (Reference or object equality,
			-- based on object_comparison.)
		deferred
		ensure
			non_negative_occurrences: Result >= 0
		end;

feature -- Element change

	extend (v: G) is
			-- Add a new occurrence of v.
		deferred
		ensure
			one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
		end;

end -- class BAG