Class MCType

  • All Implemented Interfaces:
    IMCType

    public class MCType
    extends java.lang.Object
    implements IMCType
    Base implementation of the IMCType interface.
    • 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.
    • Field Detail

      • UNKNOWN

        static final IMCType UNKNOWN
        Constant indicating an unknown Java type. Only used to avoid returning null types.
      • fullName

        private final java.lang.String fullName
      • typeName

        private final java.lang.String typeName
    • Constructor Detail

      • MCType

        MCType​(java.lang.String jlsTypeName)
        Create an instance from a binary Java type name according to The Java Language Specification, Section 13.1.
        Parameters:
        jlsTypeName - JLS type name
    • 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 interface IMCType
        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 interface IMCType
        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 interface IMCType
        Returns:
        the fully qualified name (both package and type name)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object