KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > repository > RawResourceInfo


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.repository;
24
25 import java.util.Hashtable JavaDoc;
26
27 /**
28  * Intermediate representation of J2EE resource information.
29  *
30  * @author Kenneth Saks
31  */

32 public class RawResourceInfo {
33
34     private String JavaDoc resourceType_;
35     private int index_;
36     private Hashtable JavaDoc attributes_;
37     private Hashtable JavaDoc properties_;
38
39     public RawResourceInfo(String JavaDoc resourceType, int index) {
40         resourceType_ = resourceType;
41         index_ = index;
42         attributes_ = new Hashtable JavaDoc();
43         properties_ = new Hashtable JavaDoc();
44     }
45
46     public String JavaDoc getResourceType() {
47         return resourceType_;
48     }
49     
50     public int getIndex() {
51         return index_;
52     }
53
54     public Hashtable JavaDoc getAttributes() {
55         return attributes_;
56     }
57
58     public Hashtable JavaDoc getProperties() {
59         return properties_;
60     }
61
62     public int hashCode() {
63         return resourceType_.hashCode();
64     }
65
66     public boolean equals(Object JavaDoc o) {
67         if( o instanceof RawResourceInfo ) {
68             RawResourceInfo other = (RawResourceInfo) o;
69             return other.resourceType_.equals(resourceType_) &&
70                 (other.index_ == index_);
71         } else {
72             return false;
73         }
74     }
75
76     public String JavaDoc toString() {
77         return "< Raw resource info : " + getResourceType() + " , " +
78             getIndex() + " , " + getAttributes() + " , " +
79             getProperties() + " >";
80     }
81 }
82
Popular Tags