Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ObjectType.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.Constants;
00004 
00005 /** 
00006  * Denotes reference such as java.lang.String.
00007  *
00008  * @version $Id: ObjectType.java,v 1.1.1.1 2002/01/24 03:41:41 pserver Exp $
00009  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00010  */
00011 public final class ObjectType extends ReferenceType {
00012   private String class_name; // Class name of type
00013 
00014   /**
00015    * @param class_name fully qualified class name, e.g. java.lang.String
00016    */ 
00017   public ObjectType(String class_name) {
00018     super(Constants.T_REFERENCE, "L" + class_name.replace('.', '/') + ";");
00019     this.class_name = class_name.replace('/', '.');
00020   }  
00021   /** @return true if both type objects refer to the same class.
00022    */
00023   public boolean equals(Object type) {
00024     return (type instanceof ObjectType)?
00025       ((ObjectType)type).class_name.equals(class_name) : false;
00026   }  
00027   /** @return name of referenced class
00028    */
00029   public String getClassName() { return class_name; }  
00030   /** @return a hash code value for the object.
00031    */
00032   public int hashCode()  { return class_name.hashCode(); }  
00033 }

Generated at Thu Feb 7 06:50:51 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001