KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > emn > info > eaop > aspect > BinaryAspectS


1 /* ----------------------------------------------------------------------------
2  * EAOP 1.0, 2002-12-19
3  * (c) 2002 Remi Douence, Mario Sudholt; OBASCO group; EMN/INRIA; France
4  * THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY
5   -------------------------------------------------------------------------- */

6
7 package fr.emn.info.eaop.aspect;
8
9 import java.util.*;
10 import java.lang.reflect.*;
11 import java.io.*;
12
13 /**
14  * This class implements binary nodes in the tree of aspects.
15  *
16  * @author RD
17  * @version 1.0
18  */

19 public abstract class BinaryAspectS extends AspectS {
20
21     public AspectS a1;
22     public AspectS a2;
23
24     public BinaryAspectS(AspectS a1, AspectS a2, AspectS up) {
25     super(up);
26     this.a1 = a1;
27     this.a2 = a2;
28     this.a1.up = this;
29     this.a2.up = this;
30     }
31     public void insert(AspectS child, AspectS newAspect) {
32     if (this.a1 == child) {
33         this.a1 = new Any(child, newAspect);
34         this.a1.up = this;
35     } else {
36         this.a2 = new Any(child, newAspect);
37         this.a2.up = this;
38     }
39     }
40 }
41
42
Popular Tags