home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------------
- --
- -- Copyright (c) 1994 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 : @(#)RefSet.4gl 1.1
- -- Author :
- -- Original date : 19-10-1994
- -- Description : A 'simple' set of object references
- --
- -----------------------------------------------------------------------------
-
- INCLUDE "RefSet.4gh"
-
-
- FUNCTION RefSet::RefSet()
- LET s = NEW ORefSet()
- LET curr = 0
- END FUNCTION
-
- FUNCTION RefSet::add(ref ixObject) RETURNING BOOLEAN
- IF isPresent(ref) THEN
- RETURN FALSE
- END IF
-
- IF s.append(ref) == 0 THEN
- RETURN FALSE
- END IF
-
- RETURN TRUE
- END FUNCTION
-
- FUNCTION RefSet::remove(ref ixObject) RETURNING VOID
- CALL s.remove(ref)
- END FUNCTION
-
- FUNCTION RefSet::isPresent(ref ixObject) RETURNING BOOLEAN
- VARIABLE i INTEGER
-
- FOR i = 1 TO s.getCount()
- IF ref == s.get(i) THEN
- RETURN TRUE
- END IF
- END FOR
-
- RETURN FALSE
- END FUNCTION
-
- FUNCTION RefSet::size() RETURNING INTEGER
- RETURN s.getCount()
- END FUNCTION
-
- FUNCTION RefSet::first() RETURNING ixObject
- LET curr = 1
- RETURN s.get(curr)
- END FUNCTION
-
- FUNCTION RefSet::next() RETURNING ixObject
- LET curr = curr + 1
- RETURN s.get(curr)
- END FUNCTION
-