Codota Logo
CharOperation.endsWith
Code IndexAdd Codota to your IDE (free)

How to use
endsWith
method
in
org.eclipse.jdt.core.compiler.CharOperation

Best Java code snippets using org.eclipse.jdt.core.compiler.CharOperation.endsWith (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: INRIA/spoon

private void sortModuleDeclarationsFirst(ICompilationUnit[] sourceUnits) {
  Arrays.sort(sourceUnits, (u1, u2) -> {
    char[] fn1 = u1.getFileName();
    char[] fn2 = u2.getFileName();
    boolean isMod1 = CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_CLASS_NAME);
    boolean isMod2 = CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_CLASS_NAME);
    if (isMod1 == isMod2) {
      return 0;
    }
    return isMod1 ? -1 : 1;
  });
}
origin: INRIA/spoon

for (CompilationUnit compilationUnit : this.compilationUnits) {
  char[] charName = compilationUnit.getFileName();
  boolean isModuleInfo = CharOperation.endsWith(charName, TypeConstants.MODULE_INFO_FILE_NAME);
  if (isModuleInfo == (round == 0)) { // 1st round: modules, 2nd round others (to ensure populating pathToModCU well in time)
origin: org.eclipse.jdt/org.eclipse.jdt.core

private void sortModuleDeclarationsFirst(ICompilationUnit[] sourceUnits) {
  Arrays.sort(sourceUnits, (u1, u2) -> {
    char[] fn1 = u1.getFileName();
    char[] fn2 = u2.getFileName();
    boolean isMod1 = CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_CLASS_NAME);
    boolean isMod2 = CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_CLASS_NAME);
    if (isMod1 == isMod2)
      return 0;
    return isMod1 ? -1 : 1;
  });
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

private void sortModuleDeclarationsFirst(ICompilationUnit[] sourceUnits) {
  Arrays.sort(sourceUnits, (u1, u2) -> {
    char[] fn1 = u1.getFileName();
    char[] fn2 = u2.getFileName();
    boolean isMod1 = CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_CLASS_NAME);
    boolean isMod2 = CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_CLASS_NAME);
    if (isMod1 == isMod2)
      return 0;
    return isMod1 ? -1 : 1;
  });
}
origin: windup/windup

private void sortModuleDeclarationsFirst(ICompilationUnit[] sourceUnits) {
  Arrays.sort(sourceUnits, (u1, u2) -> {
    char[] fn1 = u1.getFileName();
    char[] fn2 = u2.getFileName();
    boolean isMod1 = CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn1, TypeConstants.MODULE_INFO_CLASS_NAME);
    boolean isMod2 = CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_FILE_NAME) || CharOperation.endsWith(fn2, TypeConstants.MODULE_INFO_CLASS_NAME);
    if (isMod1 == isMod2)
      return 0;
    return isMod1 ? -1 : 1;
  });
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

@Override
public ModuleBinding module(LookupEnvironment rootEnvironment) {
  if (this.moduleBinding != null)
    return this.moduleBinding;
  if (this.modCU != null)
    return this.moduleBinding = this.modCU.module(rootEnvironment);
  if (CharOperation.endsWith(this.fileName, TypeConstants.MODULE_INFO_FILE_NAME)) {
    this.moduleBinding = rootEnvironment.getModule(this.module);
    if (this.moduleBinding == null)
      throw new IllegalStateException("Module should be known"); //$NON-NLS-1$
    return this.moduleBinding;
  }
  return rootEnvironment.UnNamedModule;
}
public String getDestinationPath() {
origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: trylimits/Eclipse-Postfix-Code-Completion

public void acceptType(
    char[] packageName,
    char[] typeName,
    char[][] enclosingTypeNames,
    int modifiers,
    AccessRestriction accessRestriction) {
  char[] fullyQualifiedName = CharOperation.concat(packageName, CharOperation.concat(CharOperation.concatWith(enclosingTypeNames, '.'), typeName, '.'), '.');
  if (isQualified && !CharOperation.endsWith(fullyQualifiedName, missingFullyQualifiedName)) return;
  char[][] compoundName = CharOperation.splitOn('.', fullyQualifiedName);
  results.add(compoundName);
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: org.eclipse.tycho/org.eclipse.jdt.core

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: trylimits/Eclipse-Postfix-Code-Completion

protected boolean matches(char[][] compoundName) {
  int length = compoundName.length;
  if (length == 0) return false;
  char[] simpleName = compoundName[length-1];
  int last = length - 1;
  if (this.typeSimpleName == null || this.pattern.matchesName(simpleName, this.typeSimpleName)) {
    // most frequent case: simple name equals last segment of compoundName
    char[][] qualification = new char[last][];
    System.arraycopy(compoundName, 0, qualification, 0, last);
    return this.pattern.matchesName(this.typeQualification, CharOperation.concatWith(qualification, '.'));
  }

  if (!CharOperation.endsWith(simpleName, this.typeSimpleName)) return false;

  // member type -> transform A.B.C$D into A.B.C.D
  System.arraycopy(compoundName, 0, compoundName = new char[length+1][], 0, last);
  int dollar = CharOperation.indexOf('$', simpleName);
  if (dollar == -1) return false;
  compoundName[last] = CharOperation.subarray(simpleName, 0, dollar);
  compoundName[length] = CharOperation.subarray(simpleName, dollar+1, simpleName.length);
  return this.matches(compoundName);
}
protected boolean matches(ReferenceBinding binding) {
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

private boolean isForbiddenType(char[] givenPkgName, char[] givenTypeName, char[][] enclosingTypeNames) {
  // CharOperation.concatWith() handles the cases where input args are null/empty
  char[] fullTypeName = CharOperation.concatWith(enclosingTypeNames, givenTypeName, '.');
  for (int i = 0; i <= this.forbbidenBindingsPtr; i++) {
    if (this.forbbidenBindings[i] instanceof TypeBinding) {
      TypeBinding typeBinding = (TypeBinding) this.forbbidenBindings[i];
      char[] currPkgName = typeBinding.qualifiedPackageName();
      if (CharOperation.equals(givenPkgName, currPkgName))	{
        char[] currTypeName = typeBinding.qualifiedSourceName();
        if (CharOperation.equals(fullTypeName, currTypeName)) {
          return true;
        }
      }
    }
  }
  
  // filter packages ending with enum for projects above 1.5 
  // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=317264
  if (this.compilerOptions.sourceLevel >= ClassFileConstants.JDK1_5 &&
      CharOperation.endsWith(givenPkgName, DOT_ENUM)) { //note: it should be .enum and not just enum
      return true;
  }
  
  return false;
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

private void findModuleName(CompilationUnitDeclaration parsedUnit) {
  char[] fileName1 = parsedUnit.getFileName();
  if (fileName1 == null || !CharOperation.endsWith(fileName1, MODULE_INFO_FILE_NAME)) return;
  int lastFileSeparatorIndex = fileName1.length - (MODULE_INFO_FILE_NAME.length + 1);
  if (lastFileSeparatorIndex  <= 0) return;
  int prevFileSeparatorIndex = CharOperation.lastIndexOf(fileName1[lastFileSeparatorIndex], fileName1, 0, lastFileSeparatorIndex - 1);
  prevFileSeparatorIndex = prevFileSeparatorIndex < 0 ? 0 : prevFileSeparatorIndex + 1;
  char[] moduleName = CharOperation.subarray(fileName1, prevFileSeparatorIndex, lastFileSeparatorIndex);
  if (moduleName == null || moduleName.length == 0) return;
  this.completionToken = CharOperation.concatWith(this.moduleDeclaration.tokens, '.');
  if (this.completionToken.length > 0 && !CharOperation.prefixEquals(this.completionToken, moduleName)) return;
  InternalCompletionProposal proposal =  createProposal(CompletionProposal.MODULE_DECLARATION, this.actualCompletionPosition);
  proposal.setName(moduleName);
  proposal.setCompletion(moduleName);
  proposal.setReplaceRange((this.startPosition < 0) ? 0 : this.startPosition - this.offset, this.endPosition - this.offset);
  proposal.setTokenRange((this.tokenStart < 0) ? 0 : this.tokenStart - this.offset, this.tokenEnd - this.offset);
  proposal.setRelevance(R_MODULE_DECLARATION);
  this.requestor.accept(proposal);
  if(DEBUG) {
    this.printDebug(proposal);
  }
}
org.eclipse.jdt.core.compilerCharOperationendsWith

Javadoc

Return true if array ends with the sequence of characters contained in toBeFound, otherwise false.

For example:
  1.  
    array = { 'a', 'b', 'c', 'd' } 
    toBeFound = { 'b', 'c' } 
    result => false 
    
  2.  
    array = { 'a', 'b', 'c' } 
    toBeFound = { 'b', 'c' } 
    result => true 
    

Popular methods of CharOperation

  • equals
    If isCaseSensite is true, answers true if the two arrays are identical character by character, other
  • lastIndexOf
    Answers the last index in the array for which the corresponding character is equal to toBeFound star
  • splitOn
    Return a new array which is the split of the given array using the given divider. The given end is e
  • subarray
    Answers a new array which is a copy of the given array starting at the given start and ending at the
  • toString
    Answers a string which is the concatenation of the given array using the '.' as a separator. For ex
  • arrayConcat
    Answers the concatenation of the two arrays. It answers null if the two arrays are null. If the firs
  • camelCaseMatch
    Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. char[]
  • concatWith
    Answers the concatenation of the given array parts using the given separator between each part and a
  • pathMatch
    Answers true if the pattern matches the filepath using the pathSepatator, false otherwise. Path char
  • indexOf
    Answers the first index in the array for which the toBeFound array is a matching subarray following
  • replace
    Answers a new array of characters with substitutions. No side-effect is operated on the original arr
  • compareTo
    Compares the two char arrays lexicographically between the given start and end positions. Returns a
  • replace,
  • compareTo,
  • concat,
  • fragmentEquals,
  • isWhitespace,
  • match,
  • replaceOnCopy,
  • hashCode,
  • prefixEquals,
  • deepCopy

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • orElseThrow (Optional)
  • getSharedPreferences (Context)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JList (javax.swing)
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now