KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > ide > Type


1 /*
2   Copyright (C) 2002-2003 Renaud Pawlak <renaud@aopsys.com>
3
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12   GNU Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.ide;
20
21 /**
22  * A representation of a type. It can be an external type --
23  * e.g. <code>java.util.Vector</code> or an internally defined class
24  * or typed element.
25  *
26  * @see Class
27  * @see Aspect */

28
29 public class Type extends ModelElement {
30
31    public Type() {}
32
33    public Type(String JavaDoc name, String JavaDoc packagePath) {
34       super(name);
35       this.packagePath = packagePath;
36    }
37
38    public String JavaDoc getFullName() {
39       if (packagePath != null && !packagePath.equals("")) {
40          return packagePath+"."+name;
41       } else {
42          return name;
43       }
44    }
45
46    public boolean isPrimitive() {
47       return Character.getType(name.charAt(0))==Character.LOWERCASE_LETTER;
48    }
49
50    String JavaDoc packagePath="";
51    
52    /**
53     * Get the value of packagePath.
54     * @return value of packagePath.
55     */

56    public String JavaDoc getPackagePath() {
57       return packagePath;
58    }
59    
60    /**
61     * Set the value of packagePath.
62     * @param v Value to assign to packagePath.
63     */

64    public void setPackagePath(String JavaDoc v) {
65       this.packagePath = v;
66    }
67    
68 }
69
Popular Tags