Gets the class name.

@param sourceCode the source code
@return the class name
176549
public static String getClassName(String sourceCode) {
		int index = sourceCode.indexOf(" class ");
		int lastIndex = sourceCode.indexOf("{");
		String className = sourceCode.substring(index + 6, lastIndex).trim();
		return className;
	}
754174
public String code(String classificationName, String elementName) {
        assertArgumentNotNull("classificationName", classificationName);
        assertArgumentNotNull("elementName", elementName);
        final ClassificationMeta meta = findClassificationMeta((String) classificationName, () -> {
            return "code('" + classificationName + "', '" + elementName + "')";
        });
        final Classification cls = meta.nameOf(elementName);
        assertClassificationByNameExists(classificationName, elementName, cls);
        return cls.code();
    }
536162
def _get_class_name(error_code):
    
    if isinstance(error_code, int):
        return KNOWN_BASE_CLASSES.get(
            error_code, 'RPCError' + str(error_code).replace('-', 'Neg')
        )

    return snake_to_camel_case(
        error_code.replace('FIRSTNAME', 'FIRST_NAME').lower(), suffix='Error')
956004
public function extractClassName()
    {
        $tokens = token_get_all($this->phpCode);
        $numberOfTokens = count($tokens);
        for ($i = 0; $i < $numberOfTokens; $i++) {
            $token = $tokens[$i];
            if (is_string($token) || $token[0] !== T_CLASS) {
                continue;
            }
            for (++$i; $i < $numberOfTokens; $i++) {
                $token = $tokens[$i];
                if (is_string($token)) {
                    break;
                }
                list($type, $value) = $token;
                if ($type === T_STRING) {
                    return $value;
                }
                if ($type !== T_WHITESPACE) {
                    break;
                }
            }
        }
        return null;
    }
503247
public static String getEntityClassName(Class<?> clazz) {
    String name = clazz.getName();
    int dollar = name.indexOf("_$$_");
    if (-1 == dollar) {
      return name;
    } else {
      return name.substring(0, dollar);
    }
  }
640395
private static String getSimpleClassName(final String fullyQualifiedClassName) {
		int dotIndex = fullyQualifiedClassName.lastIndexOf('.');
		if (dotIndex < 0) {
			return fullyQualifiedClassName;
		} else {
			return fullyQualifiedClassName.substring(dotIndex + 1);
		}
	}
594396
public String getClassTypeName(Class<?> clazz) {
        
        String type = null;

        if (clazz.isInterface()) {
            type = "interface";
        }
        else if (clazz.isPrimitive() || clazz.isArray()) {
            // type already null
        }
        else {
            type = "class";
        }

        return type;
    }
1284165
public String[] getClassnames(Class superclass) {
    List<String>	list;

    list = m_ListNames.get(superclass.getName());
    if (list == null)
      return new String[0];
    else
      return list.toArray(new String[list.size()]);
  }
1178993
static String getClassName(ClassSymbol c, boolean full) {
        if (full) {
            return c.getQualifiedName().toString();
        } else {
            String n = "";
            for ( ; c != null; c = c.owner.enclClass()) {
                n = c.name + (n.equals("") ? "" : ".") + n;
            }
            return n;
        }
    }
130417
public ClassName getGeneratedClass() {
		String packageName = getElement().asType().toString();
		return TypeUtility
				.className(packageName.substring(0, packageName.lastIndexOf(".")) + "." + getGeneratedClassName());
	}
105425
public static String getClassName(Class<?> cls) {
        if (cls.isMemberClass()) {
            String name = cls.getName();
            name = StringUtils.substringAfterLast(name, PACKAGE_SEPARATOR);
            return name;
        }

        return cls.getSimpleName();
    }
275966
public static String getClassFileName(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		String className = clazz.getName();
		int lastDotIndex = className.lastIndexOf(PACKAGE_SEPARATOR);
		return className.substring(lastDotIndex + 1) + CLASS_FILE_SUFFIX;
	}
930522
private String computeShortClassName() {
        String name = this.getClass().getSimpleName();
        if (name.endsWith(APP_SUFFIX_CLASSNAME)) {
            name = name.substring(0, name.indexOf(APP_SUFFIX_CLASSNAME));
        }
        return name;
    }
1310359
@Nullable
  public CharSequence getSourceCode() {
    try {
      return getPath().getCompilationUnit().getSourceFile().getCharContent(false);
    } catch (IOException e) {
      return null;
    }
  }
389519
public static String getClassName( final Class<?> clazz ) {
        final String fullName = clazz.getName();
        final int fullNameLength = fullName.length();

        // Check for array ('[') or the class/interface marker ('L') ...
        int numArrayDimensions = 0;
        while (numArrayDimensions < fullNameLength) {
            final char c = fullName.charAt(numArrayDimensions);
            if (c != '[') {
                String name = null;
                // Not an array, so it must be one of the other markers ...
                switch (c) {
                    case 'L': {
                        name = fullName.subSequence(numArrayDimensions + 1, fullNameLength).toString();
                        break;
                    }
                    case 'B': {
                        name = "byte";
                        break;
                    }
                    case 'C': {
                        name = "char";
                        break;
                    }
                    case 'D': {
                        name = "double";
                        break;
                    }
                    case 'F': {
                        name = "float";
                        break;
                    }
                    case 'I': {
                        name = "int";
                        break;
                    }
                    case 'J': {
                        name = "long";
                        break;
                    }
                    case 'S': {
                        name = "short";
                        break;
                    }
                    case 'Z': {
                        name = "boolean";
                        break;
                    }
                    case 'V': {
                        name = "void";
                        break;
                    }
                    default: {
                        name = fullName.subSequence(numArrayDimensions, fullNameLength).toString();
                    }
                }
                if (numArrayDimensions == 0) {
                    // No array markers, so just return the name ...
                    return name;
                }
                // Otherwise, add the array markers and the name ...
                if (numArrayDimensions < BRACKETS_PAIR.length) {
                    name = name + BRACKETS_PAIR[numArrayDimensions];
                } else {
                    for (int i = 0; i < numArrayDimensions; i++) {
                        name = name + BRACKETS_PAIR[1];
                    }
                }
                return name;
            }
            ++numArrayDimensions;
        }

        return fullName;
    }
166896
static String getClassSimpleName(String className) {
    int lastPeriod = className.lastIndexOf(".");
    if (lastPeriod != -1) {
      return className.substring(lastPeriod + 1);
    }
    return className;
  }
1002896
private void initialize(SourceCode sourceCode) {
	this.sourceCode = sourceCode;
	textWithSource = new StringWithLocation(sourceCode);
	text = textWithSource.getText();

	memo.clear();
	ruleInvocationStack = null;
	maxPosition = 0;
    }