|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 11264 (0x2c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Generic_String_Sort_Array, seg_040526
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
package body Generic_String_Sort_Array is
function Is_Empty (Collection : in Object) return Boolean is
begin
return Collection.The_Array.Length = 0;
end Is_Empty;
function Index (Collection : in Object; Key : in String)
return Element_Index is
Low, Mid, High : Element_Index;
Item_Found : Boolean := False;
Index : Element_Index := 0;
begin
if not Is_Empty (Collection) then
Low := 1;
High := Collection.The_Array.Inner'Last;
while Low <= High and not Item_Found loop
Mid := (Low + High) / 2;
if Get_Key (Collection.The_Array.Inner (Mid)) < Key then
Low := Mid + 1;
elsif Get_Key (Collection.The_Array.Inner (Mid)) > Key then
High := Mid - 1;
else
Item_Found := True;
end if;
end loop;
if Item_Found then
Index := Mid;
end if;
end if;
return Index;
end Index;
procedure Put (Collection : in out Object;
Item : in Element;
Found : out Boolean) is
Index : Element_Index := 1;
Temporary_Array : Unconstraint_Array
(1 .. Collection.The_Array.Inner'Last + 1);
begin
if Is_Empty (Collection) then
Found := False;
Collection.The_Array := (Length => 1, Inner => (others => Item));
else
while Index in Collection.The_Array.Inner'Range and then
Get_Key (Collection.The_Array.Inner (Index)) <
Get_Key (Item) loop
Index := Index + 1;
end loop;
if Index not in Collection.The_Array.Inner'Range then
Found := False;
Temporary_Array := Collection.The_Array.Inner & Item;
Collection.The_Array := (Length =>
Collection.The_Array.Length + 1,
Inner => Temporary_Array);
elsif Get_Key (Collection.The_Array.Inner (Index)) /=
Get_Key (Item) then
Found := False;
Temporary_Array :=
Collection.The_Array.Inner (1 .. Index - 1) & Item &
Collection.The_Array.Inner
(Index .. Collection.The_Array.Inner'Last);
Collection.The_Array := (Length =>
Collection.The_Array.Length + 1,
Inner => Temporary_Array);
else
Found := True;
end if;
end if;
end Put;
procedure Put (Collection : in out Object; Item : in Element) is
Index : Element_Index := 1;
begin
if not Is_Empty (Collection) then
while Index in Collection.The_Array.Inner'Range and then
Get_Key (Collection.The_Array.Inner (Index)) /=
Get_Key (Item) loop
Index := Index + 1;
end loop;
if Index in Collection.The_Array.Inner'Range then
Collection.The_Array.Inner (Index) := Item;
end if;
end if;
end Put;
procedure Get (Collection : in Object;
Item : in out Element;
Key : in String;
Found : out Boolean) is
Low, Mid, High : Element_Index;
Item_Found : Boolean := False;
begin
if Is_Empty (Collection) then
Found := False;
else
Low := 1;
High := Collection.The_Array.Inner'Last;
while Low <= High and not Item_Found loop
Mid := (Low + High) / 2;
if Get_Key (Collection.The_Array.Inner (Mid)) < Key then
Low := Mid + 1;
elsif Get_Key (Collection.The_Array.Inner (Mid)) > Key then
High := Mid - 1;
else
Item_Found := True;
end if;
end loop;
if Item_Found then
Found := True;
Item := Collection.The_Array.Inner (Mid);
else
Found := False;
end if;
end if;
end Get;
procedure Get (Collection : in Object;
Item : in out Element;
Key : in Element_Index;
Found : out Boolean) is
begin
if Key not in Collection.The_Array.Inner'Range then
Found := False;
else
Found := True;
Item := Collection.The_Array.Inner (Key);
end if;
end Get;
procedure Create (Collection : in Object; An_Iterator : in out Iterator) is
begin
An_Iterator.Collection := Collection;
An_Iterator.Index := 1;
end Create;
function Is_At_End (An_Iterator : in Iterator) return Boolean is
begin
if Is_Empty (An_Iterator.Collection) then
return True;
else
return An_Iterator.Index =
An_Iterator.Collection.The_Array.Length + 1;
end if;
end Is_At_End;
function Value (An_Iterator : in Iterator) return Element is
begin
return An_Iterator.Collection.The_Array.Inner (An_Iterator.Index);
end Value;
procedure Next (An_Iterator : in out Iterator) is
begin
An_Iterator.Index := An_Iterator.Index + 1;
end Next;
end Generic_String_Sort_Array;
nblk1=a
nid=2
hdr6=c
[0x00] rec0=20 rec1=00 rec2=01 rec3=01c
[0x01] rec0=1d rec1=00 rec2=05 rec3=02a
[0x02] rec0=16 rec1=00 rec2=06 rec3=006
[0x03] rec0=1d rec1=00 rec2=03 rec3=064
[0x04] rec0=1d rec1=00 rec2=0a rec3=068
[0x05] rec0=24 rec1=00 rec2=08 rec3=000
[0x06] rec0=21 rec1=00 rec2=05 rec3=001
[0x07] rec0=68 rec1=60 rec2=a6 rec3=623
[0x08] rec0=57 rec1=3c rec2=00 rec3=006
[0x09] rec0=2d rec1=0c rec2=14 rec3=6c4
tail 0x217407f76860e6e6a7ead 0x42a00088462060003
Free Block Chain:
0x2: 0000 00 07 03 fc 80 09 64 20 6c 6f 6f 70 3b 20 20 09 ┆ d loop; ┆
0x7: 0000 00 04 00 06 80 03 20 2b 20 03 61 74 6f 72 3b 09 ┆ + ator; ┆
0x4: 0000 00 09 00 0a 80 07 45 6c 65 6d 65 6e 74 07 6e 20 ┆ Element n ┆
0x9: 0000 00 00 00 0a 80 07 72 72 61 79 20 3a 3d 07 74 5f ┆ rray := t_┆