KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > test > replication > old > R0Linker


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o.test.replication.old;
22
23 import com.db4o.*;
24
25
26 class R0Linker {
27     
28     R0 r0;
29     R1 r1;
30     R2 r2;
31     R3 r3;
32     R4 r4;
33     
34     R0Linker(){
35         r0 = new R0();
36         r1 = new R1();
37         r2 = new R2();
38         r3 = new R3();
39         r4 = new R4();
40     }
41     
42     void setNames(String JavaDoc name){
43         r0.name = "0" + name;
44         r1.name = "1" + name;
45         r2.name = "2" + name;
46         r3.name = "3" + name;
47         r4.name = "4" + name;
48     }
49     
50     void linkCircles(){
51         linkList();
52         r1.circle1 = r0;
53         r2.circle2 = r0;
54         r3.circle3 = r0;
55         r4.circle4 = r0;
56     }
57     
58     void linkList(){
59         r0.r1 = r1;
60         r1.r2 = r2;
61         r2.r3 = r3;
62         r3.r4 = r4;
63     }
64     
65     void linkThis(){
66         r0.r0 = r0;
67         r1.r1 = r1;
68         r2.r2 = r2;
69         r3.r3 = r3;
70         r4.r4 = r4;
71     }
72     
73     void linkBack(){
74         r1.r0 = r0;
75         r2.r1 = r1;
76         r3.r2 = r2;
77         r4.r3 = r3;
78     }
79     
80     public void store(ObjectContainer oc){
81         oc.set(r4);
82         oc.set(r3);
83         oc.set(r2);
84         oc.set(r1);
85         oc.set(r0);
86     }
87     
88     
89
90 }
91
Popular Tags