JavaDoq 1.0 API

com.javadoq
Class JavaType

java.lang.Object
  extended by com.javadoq.JavaType
Direct Known Subclasses:
JavaNestedType

public class JavaType
extends java.lang.Object

Represents a Java type, either a class, an interface or enum.

Author:
J.J.Liu (Jianjun Liu) at http://www.javadoq.com

Field Summary
 SourceFile file
          The source file that defines this type.
 java.util.Map<java.lang.String,JavaNestedType> inners
          The inner type map with the simple names as the keys.
 java.lang.String name
          The simple name of this type.
 JavaName qname
          The fully qualified name of this type.
 java.util.Map<java.lang.String,JavaType> supers
          The super type map with the fully qualified names as the keys.
 
Constructor Summary
  JavaType(SourceFile file, java.lang.String name)
          Constructs a JavaType.
protected JavaType(SourceFile file, java.lang.String name, JavaName qname)
          Constructs a JavaType.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines if the current JavaType equals another object.
protected  JavaType findLocalType(JavaName name)
          Finds a Java type locally defined within this type or its super types.
protected  JavaType findNestedType(JavaName name)
          Finds a Java type nested in this type.
 JavaType findType(JavaName name)
          Finds a Java type in the scope of this type.
 int hashCode()
          Returns a hash code of the current JavaType.
 JavaType searchType(JavaName name)
          Searches for a Java type from the scope of this type.
 java.lang.String toString()
          Returns a string representation of this type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

inners

public final java.util.Map<java.lang.String,JavaNestedType> inners

The inner type map with the simple names as the keys.

Since:
1.0

supers

public final java.util.Map<java.lang.String,JavaType> supers

The super type map with the fully qualified names as the keys.

Since:
1.0

file

public final SourceFile file

The source file that defines this type.

Since:
1.0

name

public final java.lang.String name

The simple name of this type.

Since:
1.0

qname

public final JavaName qname

The fully qualified name of this type.

Since:
1.0
Constructor Detail

JavaType

protected JavaType(SourceFile file,
                   java.lang.String name,
                   JavaName qname)

Constructs a JavaType.

Parameters:
file - The source file that defines the type being constructed.
name - The simple name for the type.
qname - The fully qualified name of the type.
Since:
1.0

JavaType

public JavaType(SourceFile file,
                java.lang.String name)

Constructs a JavaType.

Parameters:
file - The source file that defines the type being constructed.
name - The simple name for the type.
Since:
1.0
Method Detail

findNestedType

protected final JavaType findNestedType(JavaName name)

Finds a Java type nested in this type.

Parameters:
name - The simple name for the type being found.
Returns:
The matched Java type or null if it is not found.
Since:
1.0

findLocalType

protected JavaType findLocalType(JavaName name)

Finds a Java type locally defined within this type or its super types.

Parameters:
name - The simple name for the type being found.
Returns:
The matched Java type or null if it is not found.
Since:
1.0

findType

public final JavaType findType(JavaName name)

Finds a Java type in the scope of this type.

Parameters:
name - The name for the type being found.
Returns:
The matched Java type or null if it is not found.
Since:
1.0

searchType

public final JavaType searchType(JavaName name)

Searches for a Java type from the scope of this type.

Parameters:
name - The name for the type being searched for.
Returns:
The matched Java type or null if it is not found.
Since:
1.0

equals

public boolean equals(java.lang.Object o)

Determines if the current JavaType equals another object.

Overrides:
equals in class java.lang.Object
Parameters:
o - An object.
Returns:
true if the given object is an instance of JavaType and its qname is equal to that of the current one.
Since:
1.0

hashCode

public int hashCode()

Returns a hash code of the current JavaType.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code of the current JavaType that is same as that of its qname.
Since:
1.0

toString

public java.lang.String toString()

Returns a string representation of this type.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this type, that is, the fully qualified name of the type.
Since:
1.0

JavaDoq 1.0 API

Copyright © 2008-2011 J.J.Liu (www.javadoq.com). All Rights Reserved.