KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > DiningPhilosophers > cif > StatusInfoImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle, Sylvain Leblanc.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package DiningPhilosophers.cif;
28
29 import DiningPhilosophers.*;
30
31 /**
32  * This is the implementation of the OMG IDL3
33  * DiningPhilosophers::StatusInfo valuetype.
34  *
35  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
36  * @author <a HREF="mailto:Sylvain.Leblanc@lifl.fr">Sylvain Leblanc</a>
37  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
38  *
39  * @version 2.0
40  */

41
42 public class StatusInfoImpl
43      extends StatusInfo
44 {
45     // ==================================================================
46
//
47
// Constructor.
48
//
49
// ==================================================================
50

51     /** The default constructor. */
52     public
53     StatusInfoImpl()
54     {
55         ticks_since_last_meal = 0;
56         has_left_fork = false;
57         has_right_fork = false;
58         state = PhilosopherState.DEAD;
59         name = "";
60     }
61
62     /**
63      * The constructor.
64      *
65      * @param s The philosopher initial state.
66      * @param n The philosopher name.
67      * @param ticks The philosopher hungryness.
68      * @param left_fork If the philosopher has the left fork.
69      * @param right_fork If the philosopher has the right fork.
70      */

71     public
72     StatusInfoImpl(PhilosopherState s,
73                    String JavaDoc n,
74                    int ticks,
75                    boolean left_fork,
76                    boolean right_fork)
77     {
78         state = s;
79         name = n;
80         ticks_since_last_meal = ticks;
81         has_left_fork = left_fork;
82         has_right_fork = right_fork;
83     }
84 }
85
Popular Tags