history.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
class HISTORY
class HISTORY is
-- 1998/4/4 K.Kodama
const historyLength:CARD:=100;
shared KnotHistory:ARRAY{KNOT};
shared historyPtr:CARD:=0;
setTable is
if void(KnotHistory) then
KnotHistory:=#(historyLength);
loop KnotHistory[KnotHistory.ind!]:=#; end;
end;
end;
create:SAME is
setTable;
return self;
end;
length:CARD is
return historyLength;
end;
put(Knot:KNOT) is
setTable;
KnotHistory[historyPtr]:=Knot.clone;
historyPtr:=(historyPtr+historyLength+1).mod(historyLength);
end;
back(inout Knot:KNOT) is
setTable;
KnotHistory[historyPtr]:=Knot.clone;
historyPtr:=(historyPtr+historyLength-1).mod(historyLength);
Knot:=KnotHistory[historyPtr].clone;
if void(Knot) then Knot.NoCompo0; end;
end;
forward(inout Knot:KNOT) is
setTable;
KnotHistory[historyPtr]:=Knot.clone;
historyPtr:=(historyPtr+historyLength+1).mod(historyLength);
Knot:=KnotHistory[historyPtr].clone;
if void(Knot) then Knot.NoCompo0; end;
end;
end;