Alex Rivera | Logout

Is there anything like a map or a hashtable in Delphi 6?

Asked 2010-05-19T13:58:34.480
17

Is there any kind of native map implementation in delphi 6 (map keys to values and objects) - the internet has been of no help so far. I just got a delphi project dumped on my, my background is c++ and java, and the previous dev of the delphi project does all the searching linearly.

Thanks.

Edit
Report

1 Answer

4

The Jedi Code Library contains some advanced container classes. Interfaces are declared in JclContainerIntf.pas, for example:

  IJclMap = interface(IJclContainer)
    ['{A7D0A882-6952-496D-A258-23D47DDCCBC4}']
    procedure Clear;
    function ContainsKey(Key: TObject): Boolean;
    function ContainsValue(Value: TObject): Boolean;
    function Extract(Key: TObject): TObject;
    function GetValue(Key: TObject): TObject;
    function IsEmpty: Boolean;
    function KeyOfValue(Value: TObject): TObject;
    function KeySet: IJclSet;
    function MapEquals(const AMap: IJclMap): Boolean;
    procedure PutAll(const AMap: IJclMap);
    procedure PutValue(Key, Value: TObject);
    function Remove(Key: TObject): TObject;
    function Size: Integer;
    function Values: IJclCollection;
    property Items[Key: TObject]: TObject read GetValue write PutValue;
      {$IFNDEF BUGGY_DEFAULT_INDEXED_PROP} default; {$ENDIF ~BUGGY_DEFAULT_INDEXED_PROP}
  end;
answered 2010-05-19T14:07:38.147

Your Answer