~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to classfile/src/org/netbeans/modules/classfile/CPClassInfo.java

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * CPClassInfo.java
 
3
 *
 
4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 
5
 *
 
6
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
 
7
 *
 
8
 * The contents of this file are subject to the terms of either the GNU
 
9
 * General Public License Version 2 only ("GPL") or the Common
 
10
 * Development and Distribution License("CDDL") (collectively, the
 
11
 * "License"). You may not use this file except in compliance with the
 
12
 * License. You can obtain a copy of the License at
 
13
 * http://www.netbeans.org/cddl-gplv2.html
 
14
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
 
15
 * specific language governing permissions and limitations under the
 
16
 * License.  When distributing the software, include this License Header
 
17
 * Notice in each file and include the License file at
 
18
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
 
19
 * particular file as subject to the "Classpath" exception as provided
 
20
 * by Sun in the GPL Version 2 section of the License file that
 
21
 * accompanied this code. If applicable, add the following below the
 
22
 * License Header, with the fields enclosed by brackets [] replaced by
 
23
 * your own identifying information:
 
24
 * "Portions Copyrighted [year] [name of copyright owner]"
 
25
 *
 
26
 * Contributor(s):
 
27
 *
 
28
 * The Original Software is NetBeans. The Initial Developer of the Original
 
29
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
 
30
 * Microsystems, Inc. All Rights Reserved.
 
31
 *
 
32
 * If you wish your version of this file to be governed by only the CDDL
 
33
 * or only the GPL Version 2, indicate your decision by adding
 
34
 * "[Contributor] elects to include this software in this distribution
 
35
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
 
36
 * single choice of license, a recipient has the option to distribute
 
37
 * your version of this file under either the CDDL, the GPL Version 2 or
 
38
 * to extend the choice of license to its licensees as provided above.
 
39
 * However, if you add GPL Version 2 code and therefore, elected the GPL
 
40
 * Version 2 license, then the option applies only if the new code is
 
41
 * made subject to such option by the copyright holder.
 
42
 *
 
43
 * Contributor(s): Thomas Ball
 
44
 *
 
45
 * Version: $Revision: 1.6 $
 
46
 */
 
47
 
 
48
package org.netbeans.modules.classfile;
 
49
 
 
50
 
 
51
/**
 
52
 * A class representing the CONSTANT_Class constant pool type.
 
53
 *
 
54
 * @author Thomas Ball
 
55
 */
 
56
public final class CPClassInfo extends CPName {
 
57
    CPClassInfo(ConstantPool pool,int index) {
 
58
        super(pool, index);
 
59
    }
 
60
 
 
61
    public ClassName getClassName() {
 
62
        String name = super.getName();
 
63
        return ClassName.getClassName(name);
 
64
    }
 
65
 
 
66
    public final int getTag() {
 
67
        return ConstantPool.CONSTANT_Class;
 
68
    }
 
69
 
 
70
    public String toString() {
 
71
        return getClassName().toString();
 
72
    }
 
73
}