KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > lib > bean > test > SubInterface1Impl


1 /*
2  * CoadunationLib: The coaduntion implementation library.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * SubInterface1Impl.java
20  *
21  * This is a test object
22  */

23
24 // package path
25
package com.rift.coad.lib.bean.test;
26
27 // coadunation imports
28
import com.rift.coad.lib.Resource;
29 import com.rift.coad.lib.ResourceIndex;
30         
31 /**
32  * This is a test object.
33  *
34  * @author Brett Chaldecott
35  */

36 public class SubInterface1Impl implements SubInterface1, ResourceIndex, Resource {
37     
38     // the release count
39
public static int releaseCount = 0;
40     
41     
42     // private member variables
43
private String JavaDoc key = null;
44     
45     /** Creates a new instance of SubInterface1Impl */
46     public SubInterface1Impl(String JavaDoc key) {
47         this.key = key;
48     }
49     
50     /**
51      * The name of this interface
52      */

53     public String JavaDoc getName() {
54         return key;
55     }
56     
57     
58     /**
59      * This method returns the primary key of this resource to enable indexing.
60      *
61      * @return The primary key of this object.
62      */

63     public Object JavaDoc getPrimaryKey() {
64         return key;
65     }
66     
67     
68     /**
69      * This method is called to retrieve the name of the resource.
70      *
71      * @return The name of the resource.
72      */

73     public String JavaDoc getResourceName() {
74         return key;
75     }
76     
77     
78     /**
79      * This method is called to release this resource.
80      */

81     public void releaseResource() {
82         releaseCount++;
83     }
84 }
85
Popular Tags