Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: proxy/jmsapi/ProxyStoredObject.java


1   /** Java class "ProxyStoredObject.java" generated from Poseidon for UML.
2    *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
3    *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
4    */
5   package proxy.jmsapi;
6   
7   import java.util.*;
8   
9   /**
10   * <p>
11   * abstract class representing a container which stores one real JMS specific
12   * object virtually created on some mobile.
13   * </p>
14   */
15  public abstract class ProxyStoredObject implements Comparable{
16  
17    ///////////////////////////////////////
18    // attributes
19  
20  
21    /**
22     * variable used to generate unique ids. Its value means first free id to be
23     * used.
24     */
25    private static int currentId = 1;
26  
27    /**
28     * idicates type of the encapsulated object
29     */
30    public int type;
31  /**
32   * <p>
33   * a unique identifier
34   * </p>
35   */
36      public int id;
37  
38  /**
39   * <p>
40   * a id of a aplication that requested creating an encapsulated object
41   * </p>
42   */
43      public int owner;
44  
45  /**
46   * <p>
47   * a id of a mobile on which encapsulated object was virtually created
48   * </p>
49   */
50      public int mobile;
51  
52  /**
53   * <p>
54   * an encapsulated object stored on proxyServer
55   * </p>
56   */
57      private Object Obj;
58  
59    ///////////////////////////////////////
60    // operations
61  
62  
63  /**
64   * <p>
65   * get an encapsulated object
66   * </p><p>
67   * @return encapsulated object
68   * </p>
69   */
70      public Object getObj() {
71          return Obj;
72      } // end getObj
73  
74  /**
75   * <p>
76   * set an encapsulated object
77   * </p><p>
78   * @param _Obj is new  encapsulated object
79   * </p>
80   */
81      public void setObj(Object _Obj) {
82          Obj = _Obj;
83      } // end setObj
84  
85  
86  
87  /**
88   * <p>
89   * returns new unique id among all objects of this class.
90   *
91   * </p><p>
92   * @return a new id.
93   * </p>
94   */
95      public int getNextId()
96      {
97        return currentId++;
98      }
99  
100 
101     public  ProxyStoredObject()
102     {
103 
104     }
105 
106     public ProxyStoredObject(int _owner, int _mobile)
107     {
108       id = currentId++;
109       owner = _owner;
110       mobile = _mobile;
111     }
112 
113     /* z pozdrowieniami od Pawla i Juliana:
114         */
115        public int compareTo(Object obj){
116          return (new Integer(id)).compareTo((new Integer(((ProxyStoredObject)obj).id)));
117        }
118  /* z pozdrowieniami od lukasza:
119      */
120     public int compare(Object obj){
121       return (new Integer(id)).compareTo((new Integer(((ProxyStoredObject)obj).id)));
122     }
123 
124 
125 } // end ProxyStoredObject
126 
127 
128 
129 
130