View Javadoc

1   ////////////////////////////////////////////////////////////////////////////////
2   //CabaWeb
3   //Copyright (C) 2004  Thomas Vogt <Thomas.Vogt@TVC-Software.com>
4   //
5   //This library is free software; you can redistribute it and/or
6   //modify it under the terms of the GNU Lesser General Public
7   //License as published by the Free Software Foundation; either
8   //version 2.1 of the License, or (at your option) any later version.
9   //
10  //This library is distributed in the hope that it will be useful,
11  //but WITHOUT ANY WARRANTY; without even the implied warranty of
12  //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  //Lesser General Public License for more details.
14  //
15  //You should have received a copy of the GNU Lesser General Public
16  //License along with this library; if not, write to the Free Software
17  //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ////////////////////////////////////////////////////////////////////////////////
19  
20  package org.fhw.cabaweb.calculation.threads;
21  
22  /***
23   * Die Klasse dient beim Threading der Synchronisierung.
24   *
25   * @author  <a href="mailto:thomas.vogt@tvc-software.com">Thomas Vogt</a>
26   * @version Version 1.0 21.-27.08.2004
27   */
28  public class Lock extends Object
29  {
30      /*** Das Semaphore */
31      private int semaphore;
32      /*** Das Finish-Semaphore */
33      private int finishsemaphore;
34  
35  	public Lock(int param1, int param2)
36  	{
37  	}
38  
39      /***
40       *
41       */
42      public Lock()
43      {
44          super();
45  
46          this.semaphore = 0;
47          this.finishsemaphore = 0;
48      }
49  
50      /***
51       *
52       */
53      public Lock(int finishsemaphore)
54      {
55          super();
56  
57          this.semaphore = 0;
58          this.finishsemaphore = finishsemaphore;
59      }
60  
61      /***
62       * Gibt den Semaphorwert zur&uuml;ck
63       *
64       * @return semaphore
65       */
66      public int getSemaphore()
67      {
68          return semaphore;
69      }
70  
71      /***
72       * Inkrementieren des Semaphors
73       */
74      public void incrementSemaphore()
75      {
76          this.semaphore++;
77      }
78  
79      /***
80       * Dekrementieren des Semaphors
81       */
82      public void decrementSemaphore()
83      {
84          this.semaphore--;
85      }
86  
87      /***
88       * Gibt den Finish Semaphorwert zur&uuml;ck
89       *
90       * @return finishsemaphore
91       */
92      public int getFinishSemaphore()
93      {
94          return finishsemaphore;
95      }
96  
97      /***
98       * Setzt den Finish Semaphorwert
99       *
100      * @param finishsemaphore
101      */
102     public void setFinishSemaphore(int finishsemaphore)
103     {
104         this.finishsemaphore = finishsemaphore;
105     }
106 
107     /***
108      * Dekrementieren des Finish Semaphors
109      */
110     public void decrementFinishSemaphore()
111     {
112         this.finishsemaphore--;
113     }
114 
115 }