1 -- Created on: 1991-09-02
2 -- Created by: Mireille MERCIEN
3 -- Copyright (c) 1991-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 generic class HSet from PCollection (Item as Storable)
20 ---Purpose: A set is an unordered collection of items.
21 -- We can not have duplicated items in a given set.
23 raises NoSuchObject from Standard
26 class SetNode instantiates HSingleList from PCollection(Item);
28 class SetIterator from PCollection
29 ---Purpose: Iterator of the Set class.
31 raises NoMoreObject from Standard,
32 NoSuchObject from Standard
35 Create(S : HSet from PCollection)
36 returns SetIterator from PCollection;
37 ---Purpose: Creates an iterator on the set S.
38 -- Set the iterator at the beginning of the set S.
40 More(me) returns Boolean from Standard;
42 ---Purpose: Returns True if there are other items.
44 Next(me: in out) raises NoMoreObject from Standard;
46 ---Purpose: Sets the iterator to the next item.
48 Value(me) returns any Item raises NoSuchObject from Standard;
50 ---Purpose: Returns the item value corresponding to
51 -- the current position of the iterator.
54 TheIterator : SetNode;
60 Create returns mutable HSet from PCollection;
61 ---Purpose: Creation of an empty set.
63 Extent(me) returns Integer from Standard;
65 ---Purpose: Number of items in the set me
66 ---Example: if S is the set {a,b,c,d,e}
69 Last(me) returns SetNode;
71 ---Purpose: Returns the field TheLast .
72 -- (the last item enterred in the set)
74 IsEmpty(me) returns Boolean from Standard;
76 ---Purpose: Returns True if the set me is empty.
80 ---Purpose: Removes all the items of the set me.
86 Add(me : mutable; T : Item) returns Boolean from Standard;
88 ---Purpose: Adds an item T in the set me if it does not already exist.
89 -- Returns False if the item T already exists, True otherwise.
91 -- me = {a,b,c,d}, T = y
95 Remove(me : mutable; T : Item) raises NoSuchObject from Standard;
97 ---Purpose: Removes the item T in the set me
98 -- Raises an exception if the item is not in the set.
100 -- me = {a,b,c,d}, T = a
105 Union(me; B : HSet from PCollection) returns mutable HSet from PCollection;
107 ---Purpose: Creation of a set containing all the items
108 -- of the set me and all the items of the set B which
111 -- me = {a,b,c}, B = {d,a,f}
113 -- me = {a,b,c}, B = {d,a,f}
117 Intersection(me; B : HSet from PCollection) returns mutable HSet from PCollection;
119 ---Purpose: Creation of a set containing all the
120 -- items which are both in the set <me> and in the set B.
122 -- me = {a,b,c}, B = {d,a,f}
124 -- me = {a,b,c}, B = {d,a,f}
128 Difference(me; B: HSet from PCollection) returns mutable HSet from PCollection;
130 ---Purpose: Creation of a set containing the items
131 -- which are in the set me and not in the set B.
133 -- me = {a,b,c}, B = {d,a,f}
135 -- me = {a,b,c}, B = {d,a,f}
139 Contains(me; T : Item) returns Boolean from Standard;
141 ---Purpose: Returns True if an item is in the set me.
143 IsASubset(me; S : HSet from PCollection) returns Boolean from Standard;
145 ---Purpose: Returns True if a set is contained in the set me.
146 -- The two sets can be identical.
148 IsAProperSubset(me; S : HSet from PCollection) returns Boolean from
151 ---Purpose: Returns True if a set is contained in the set me.
152 -- The two sets cannot be identical.
155 returns mutable like me
158 ---C++: function call
161 ShallowDump (me; s: in out OStream)
164 ---C++: function call
169 TheExtent : Integer from Standard;