KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Jt > JtAdapter


1 package Jt;
2 import java.util.*;
3 import java.lang.reflect.*;
4 import java.beans.*;
5 import java.io.*;
6
7
8 /**
9  * Jt Implementation of the Adapter pattern.
10  */

11
12
13 abstract public class JtAdapter extends JtObject {
14
15
16   private Object JavaDoc adaptee;
17
18   public JtAdapter() {
19   }
20
21 /**
22   * Specifies the adaptee.
23   *
24   * @param adaptee adaptee
25   */

26
27   public void setAdaptee (Object JavaDoc adaptee) {
28      this.adaptee = adaptee;
29
30   }
31
32 /**
33   * Returns the adaptee.
34   */

35
36   public Object JavaDoc getAdaptee () {
37      return (adaptee);
38   }
39
40
41
42
43   /**
44     * Process object messages.
45
46     * @param event Jt Message
47     */

48
49   //abstract public Object processMessage (Object event);//{
50
/*
51    String msgid = null;
52    JtMessage e = (JtMessage) event;
53    Object content;
54
55     return (null);
56 */

57   //}
58

59   /**
60     * Unit Tests the messages processed by JtAdapter.
61     */

62
63   public static void main(String JavaDoc[] args) {
64
65     JtObject main = new JtFactory ();
66     JtMessage msg;
67     JtAdapter adapter;
68
69
70     // Create an instance of JtAdapter
71

72     adapter = (JtAdapter)
73       main.createObject ("Jt.JtAdapter", "adapter");
74
75
76          
77
78   }
79
80 }
81
Popular Tags