home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
ORSetDct.4gl
< prev
next >
Wrap
Text File
|
1996-07-02
|
2KB
|
75 lines
-----------------------------------------------------------------------------
--
-- Copyright (c) 1995 by Westmount Technology B.V., Delft, The Netherlands.
--
-- This software is furnished under a license and may be used only in
-- accordance with the terms of such license and with the inclusion of
-- the above copyright notice. This software or any other copies thereof
-- may not be provided or otherwise made available to any other person.
-- No title to and ownership of the software is hereby transferred.
--
-- The information in this software is subject to change without notice
-- and should not be construed as a commitment by Westmount Technology B.V.
--
-----------------------------------------------------------------------------
--
-- File : @(#)ORSetDct.4gl 1.1
-- Author :
-- Original date : 3-2-1995
-- Description : A simple ORSetDict (map of key-value pairs)
-- Key and value are ixObject references
--
-----------------------------------------------------------------------------
INCLUDE "ORSetDct.4gh"
FUNCTION ORSetDict::ORSetDict()
LET dict = NEW RefDict()
END FUNCTION
FUNCTION ORSetDict::append(key ixObject, value ixObject) RETURNING INTEGER
VARIABLE theORefSet ORefSet = dict.get(key) CAST ORefSet
IF theORefSet IS NULL THEN
LET theORefSet = NEW ORefSet()
CALL dict.set(key, theORefSet)
END IF
RETURN theORefSet.append(value)
END FUNCTION
FUNCTION ORSetDict::get(key ixObject) RETURNING ORefSet
RETURN dict.get(key) CAST ORefSet
END FUNCTION
FUNCTION ORSetDict::remove(key ixObject, value ixObject) RETURNING VOID
VARIABLE theORefSet ORefSet = dict.get(key) CAST ORefSet
IF theORefSet IS NULL THEN
RETURN
END IF
CALL theORefSet.remove(value)
END FUNCTION
FUNCTION ORSetDict::isPresent(key ixObject) RETURNING BOOLEAN
RETURN dict.isPresent(key)
END FUNCTION
FUNCTION ORSetDict::size() RETURNING INTEGER
RETURN dict.size()
END FUNCTION
FUNCTION ORSetDict::firstKey() RETURNING ixObject
RETURN dict.firstKey()
END FUNCTION
FUNCTION ORSetDict::nextKey() RETURNING ixObject
RETURN dict.nextKey()
END FUNCTION
FUNCTION ORSetDict::firstValue() RETURNING ORefSet
RETURN dict.firstValue() CAST ORefSet
END FUNCTION
FUNCTION ORSetDict::nextValue() RETURNING ORefSet
RETURN dict.nextValue() CAST ORefSet
END FUNCTION