Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5b4b2c5d5b
Fetching contributors…

Cannot retrieve contributors at this time

executable file 62 lines (50 sloc) 1.197 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
! ========================================================================
! Copyright (C) by GemStone Systems, Inc. 1986-2002. All Rights Reserved
!
! Name - IdGenerator.gs
! Description: Defines instance and class methods for class
! IdGenerator
!
! ========================================================================

input util/resultcheck.tpz
omit oops

level 0
expectvalue #IdGenerator
run
(Object subclass: #IdGenerator
  instVarNames: #(#currId)
  classVars: #()
  poolDictionaries: #[]
  inDictionary: UserGlobals
  constraints: #[ ]
  instancesInvariant: false
  isModifiable: false) name

%


! ------------------- Class methods for IdGenerator
category: 'Constructor'
classmethod: IdGenerator

createNew

 | temp |

 temp := self new.
 temp currId: 0.
 ^temp.

%
! ------------------- Instance methods for IdGenerator
category: 'Accessing'
method: IdGenerator
currId

   "Return the value of the instance variable 'currId'."
   ^currId
%
category: 'Updating'
method: IdGenerator
currId: newValue

   "Modify the value of the instance variable 'currId'."
   currId := newValue
%
category: 'Updating'
method: IdGenerator
next

   currId := currId + 1.
   ^currId.
%
Something went wrong with that request. Please try again.