1 -- File: IFSelect_SelectAnyList.cdl
2 -- Created: Wed Dec 9 11:57:08 1992
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1992
8 deferred class SelectAnyList from IFSelect inherits SelectDeduct
11 ---Purpose : A SelectAnyList kind Selection selects a List of an Entity, as
12 -- well as this Entity contains some. A List contains sub-entities
13 -- as one per Item, or several (for instance if an Entity binds
14 -- couples of sub-entities, each item is one of these couples).
15 -- Remark that only Entities are taken into account (neither
16 -- Reals, nor Strings, etc...)
18 -- To define the list on which to work, SelectAnyList has two
19 -- deferred methods : NbItems (which gives the length of the
20 -- list), FillResult (which fills an EntityIterator). They are
21 -- intended to get a List in an Entity of the required Type (and
22 -- consider that list is empty if Entity has not required Type)
24 -- In addition, remark that some types of Entity define more than
25 -- one list in each instance : a given sub-class of SelectAnyList
26 -- must be attached to one list
28 -- SelectAnyList keeps or rejects a sub-set of the list,
29 -- that is the Items of which rank in the list is in a given
30 -- range (for instance form 2nd to 6th, etc...)
31 -- Range is defined by two Integer values. In order to allow
32 -- external control of them, these values are not directly
33 -- defined as fields, but accessed through IntParams, that is,
34 -- referenced as Transient (Handle) objects
36 -- Warning : the Input can be any kind of Selection, BUT its
37 -- RootResult must have zero (empty) or one Entity maximum
39 uses AsciiString from TCollection, Transient, EntityIterator, Graph, IntParam
41 raises OutOfRange, InterfaceError
45 KeepInputEntity (me; iter : in out EntityIterator) is deferred;
46 ---Purpose : Keeps Input Entity, as having required type. It works by
47 -- keeping in <iter>, only suitable Entities (SelectType can be
48 -- used). Called by RootResult (which waits for ONE ENTITY MAX)
50 NbItems (me; ent : Transient) returns Integer is deferred;
51 ---Purpose : Returns count of Items in the list in the Entity <ent>
52 -- If <ent> has not required type, returned value must be Zero
55 SetRange (me : mutable; rankfrom, rankto : mutable IntParam);
56 ---Purpose : Sets a Range for numbers, with a lower and a upper limits
58 SetOne (me : mutable; rank : mutable IntParam);
59 ---Purpose : Sets a unique number (only one Entity will be sorted as True)
61 SetFrom (me : mutable; rankfrom : mutable IntParam);
62 ---Purpose : Sets a Lower limit but no upper limit
64 SetUntil (me : mutable; rankto : mutable IntParam);
65 ---Purpose : Sets an Upper limit but no lower limit (equivalent to lower 1)
67 HasLower (me) returns Boolean;
68 ---Purpose : Returns True if a Lower limit is defined
70 Lower (me) returns mutable IntParam;
71 ---Purpose : Returns Lower limit (if there is; else, value is senseless)
73 LowerValue (me) returns Integer;
74 ---Purpose : Returns Integer Value of Lower Limit (0 if none)
76 HasUpper (me) returns Boolean;
77 ---Purpose : Returns True if a Lower limit is defined
79 Upper (me) returns mutable IntParam;
80 ---Purpose : Returns Upper limit (if there is; else, value is senseless)
82 UpperValue (me) returns Integer;
83 ---Purpose : Returns Integer Value of Upper Limit (0 if none)
86 RootResult (me; G : Graph) returns EntityIterator raises InterfaceError;
87 ---Purpose : Returns the list of selected entities (list of entities
88 -- complying with rank criterium)
89 -- Error if the input list has more than one Item
91 FillResult (me; n1,n2 : Integer; ent : Transient;
92 res : in out EntityIterator) is deferred;
93 ---Purpose : Puts into <res>, the sub-entities of the list, from n1 to
94 -- n2 included. Remark that adequation with Entity's type and
95 -- length of list has already been made at this stage
96 -- Called by RootResult
99 Label (me) returns AsciiString from TCollection;
100 ---Purpose : Returns a text defining the criterium : "Componants of List "
101 -- then Specific List Label, then, following cases :
102 -- " From .. Until .." or "From .." or "Until .." or "Rank no .."
103 -- Specific type is given by deferred method ListLabel
105 ListLabel (me) returns AsciiString from TCollection is deferred;
106 ---Purpose : Returns the specific label for the list, which is included as