INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Collection, where each element must be unique"
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: set
cluster: eiffelbase
deferred class SET [G]
inherit

COLLECTION [G]
redefine
changeable_comparison_criterion,
extend,
prune,
put
end
feature -- Measurement

count: INTEGER
-- Number of items
feature -- Element change

extend, put (v: G)
-- Ensure that set includes `v'.
ensure
in_set_already: has (v) implies (count = count )
added_to_set: not has (v) implies (count = count + 1)
feature -- Removal

prune (v: G)
-- Remove `v' if present.
ensure
removed_count_change: has (v) implies (count = count - 1)
not_removed_no_count_change: not has (v) implies (count = count )
item_deleted: not has (v)

changeable_comparison_criterion: BOOLEAN
-- May `object_comparison' be changed?
-- (Answer: only if set empty; otherwise insertions might
-- introduce duplicates, destroying the set property.)
ensure
only_on_empty: Result = empty
end -- class SET

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES