KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > performance > sampledata > OrganicObjectGraphNode_17


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.performance.sampledata;
5
6 public final class OrganicObjectGraphNode_17 extends OrganicObjectGraph {
7
8   private int size = 2;
9   private int[] types = new int[] { 2, 3 };
10
11   private short f0;
12   private double f1;
13
14   public OrganicObjectGraphNode_17(int sequenceNumber, String JavaDoc envKey) {
15     super(sequenceNumber, envKey);
16   }
17
18   public OrganicObjectGraphNode_17() {
19     super();
20   }
21
22   protected int getSize() {
23     return size;
24   }
25
26   protected int getType(int index) {
27     return types[index];
28   }
29
30   protected void setValue(int index, short value) {
31     switch (index) {
32       case 0:
33         f0 = value;
34       default:
35         break;
36     }
37   }
38
39   protected void setValue(int index, double value) {
40     switch (index) {
41       case 1:
42         f1 = value;
43       default:
44         break;
45     }
46   }
47
48   public boolean equals(Object JavaDoc rawObj) {
49     if (!(rawObj instanceof OrganicObjectGraphNode_17)) { System.out.println("not instanceof"); System.out.println(rawObj.getClass().getName() + "=OrganicObjectGraphNode_17"); return false; }
50     OrganicObjectGraphNode_17 obj = (OrganicObjectGraphNode_17) rawObj;
51     if (f0 != obj.f0) return false;
52     if (f1 != obj.f1) return false;
53     return super.equals(obj);
54   }
55 }
56
Popular Tags