1 -- File: SelectExtract.cdl
2 -- Created: Tue Nov 17 19:19:26 1992
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1992
8 deferred class SelectExtract from IFSelect inherits SelectDeduct
10 ---Purpose : A SelectExtract determines a list of Entities from an Input
11 -- Selection, as a sub-list of the Input Result
12 -- It works by applying a sort criterium on each Entity of the
13 -- Input. This criterium can be applied Direct to Pick Items
14 -- (default case) or Reverse to Remove Item
16 -- Basic features (the unique Input) are inherited from SelectDeduct
18 uses AsciiString from TCollection, InterfaceModel, EntityIterator, Graph
23 ---Purpose : Initializes a SelectExtract : enforces the sort to be Direct
25 IsDirect (me) returns Boolean;
26 ---Purpose : Returns True if Sort criterium is Direct, False if Reverse
28 SetDirect (me : mutable; direct : Boolean);
29 ---Purpose : Sets Sort criterium sense to a new value
30 -- (True : Direct , False : Reverse)
32 -- Input : see SelectDeduct
35 RootResult (me; G : Graph) returns EntityIterator is virtual;
36 ---Purpose : Returns the list of selected entities. Works by calling the
37 -- method Sort on each input Entity : the Entity is kept as
38 -- output if Sort returns the same value as Direct status
40 Sort (me; rank : Integer; ent : Transient; model : InterfaceModel)
41 returns Boolean is deferred;
42 ---Purpose : Returns True for an Entity if it satisfies the Sort criterium
44 -- - <rank>, the rank of the Entity in the Iteration,
45 -- - <ent> , the Entity itself, and
46 -- - <model>, the Starting Model
47 -- Hence, the Entity to check is "model->Value(num)" (but an
48 -- InterfaceModel allows other checks)
49 -- This method is specific to each class of SelectExtract
51 SortInGraph (me; rank : Integer; ent : Transient; G : Graph)
52 returns Boolean is virtual;
53 ---Purpose : Works as Sort but works on the Graph
54 -- Default directly calls Sort, but it can be redefined
55 -- If SortInGraph is redefined, Sort should be defined even if
56 -- not called (to avoid deferred methods in a final class)
59 Label (me) returns AsciiString from TCollection;
60 ---Purpose : Returns a text saying "Picked" or "Removed", plus the
61 -- specific criterium returned by ExtractLabel (see below)
63 ExtractLabel (me) returns AsciiString from TCollection is deferred;
64 ---Purpose : Returns a text defining the criterium for extraction