Skip to content

Method: getInstance()

1: package de.fhdw.wtf.generator.java.generatorModel;
2:
3: /**
4: * A class that represents the "Int"-class from wtf-sources.
5: */
6: public final class GenIntegerClass extends GenPrimitiveClass {
7:         
8:         /**
9:          * The one instance of this class.
10:          */
11:         private static GenIntegerClass instance = null;
12:         
13:         /**
14:          * Instantiates a new GenIntegerClass.
15:          */
16:         private GenIntegerClass() {
17:                 super(GenIntegerType.getInstance());
18:         }
19:         
20:         /**
21:          * Returns the one existing instance of this class.
22:          *
23:          * @return GenIntegerClass
24:          */
25:         public static synchronized GenIntegerClass getInstance() {
26:•                if (instance == null) {
27:                         instance = new GenIntegerClass();
28:                 }
29:                 return instance;
30:         }
31:         
32: }