Package org.openjdk.jmc.common.util
Class MCType
- java.lang.Object
-
- org.openjdk.jmc.common.util.MCType
-
-
Field Summary
Fields Modifier and Type Field Description private IMCPackage
_package
private java.lang.String
fullName
private static char
INNER_CLASS_SEPARATOR
private static char
PACKAGE_SEPARATOR
private java.lang.String
typeName
(package private) static IMCType
UNKNOWN
Constant indicating an unknown Java type.
-
Constructor Summary
Constructors Constructor Description MCType(java.lang.String jlsTypeName)
Create an instance from a binary Java type name according to The Java Language Specification, Section 13.1.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
private static int
findPackageNameLength(java.lang.String jlsTypeName)
java.lang.String
getFullName()
Java type name according to The Java Language Specification, Section 13.1.IMCPackage
getPackage()
Returns the package this type was declared in.java.lang.String
getTypeName()
Returns the name of the type, without the package.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
UNKNOWN
static final IMCType UNKNOWN
Constant indicating an unknown Java type. Only used to avoid returning null types.
-
PACKAGE_SEPARATOR
private static final char PACKAGE_SEPARATOR
- See Also:
- Constant Field Values
-
INNER_CLASS_SEPARATOR
private static final char INNER_CLASS_SEPARATOR
- See Also:
- Constant Field Values
-
fullName
private final java.lang.String fullName
-
typeName
private final java.lang.String typeName
-
_package
private final IMCPackage _package
-
-
Method Detail
-
findPackageNameLength
private static int findPackageNameLength(java.lang.String jlsTypeName)
-
getPackage
public IMCPackage getPackage()
Description copied from interface:IMCType
Returns the package this type was declared in.- Specified by:
getPackage
in interfaceIMCType
- Returns:
- declaring package
-
getTypeName
public final java.lang.String getTypeName()
Description copied from interface:IMCType
Returns the name of the type, without the package.Examples are "String" and "Tread$TreadState".
- Specified by:
getTypeName
in interfaceIMCType
- Returns:
- the type name
-
getFullName
public final java.lang.String getFullName()
Description copied from interface:IMCType
Java type name according to The Java Language Specification, Section 13.1.An example is "java.lang.String".
- Specified by:
getFullName
in interfaceIMCType
- Returns:
- the fully qualified name (both package and type name)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-