KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > MutableObject


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test;
10
11 /**
12  * @version $Revision: 1.3 $
13  */

14 public class MutableObject
15 {
16    private Object JavaDoc object;
17
18    public MutableObject(Object JavaDoc object)
19    {
20       this.object = object;
21    }
22
23    public synchronized Object JavaDoc get()
24    {
25       return object;
26    }
27
28    public synchronized void set(Object JavaDoc object)
29    {
30       this.object = object;
31    }
32 }
33
Popular Tags