Tabnine Logo
CharOperation.compareWith
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null)
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
origin: org.eclipse.tycho/org.eclipse.jdt.core

public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null, method.declaringClass.qualifiedPackageName(), method.isDefault())
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
origin: trylimits/Eclipse-Postfix-Code-Completion

public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null, method.declaringClass.qualifiedPackageName(), method.isDefault())
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null, method.declaringClass.qualifiedPackageName(), method.isDefault())
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null, method.declaringClass.qualifiedPackageName(), method.isDefault())
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public int resolveLevel(Binding binding) {
  if (binding == null) return INACCURATE_MATCH;
  if (!(binding instanceof MethodBinding)) return IMPOSSIBLE_MATCH;

  MethodBinding method = (MethodBinding) binding;
  boolean skipVerif = this.pattern.findDeclarations && this.mayBeGeneric;
  int methodLevel = matchMethod(method, skipVerif);
  if (methodLevel == IMPOSSIBLE_MATCH) {
    if (method != method.original()) methodLevel = matchMethod(method.original(), skipVerif);
    if (methodLevel == IMPOSSIBLE_MATCH) {
      return IMPOSSIBLE_MATCH;
    } else {
      method = method.original();
    }
  }

  // declaring type
  if (this.pattern.declaringSimpleName == null && this.pattern.declaringQualification == null) return methodLevel; // since any declaring class will do

  boolean subType = !method.isStatic() && !method.isPrivate();
  if (subType && this.pattern.declaringQualification != null && method.declaringClass != null && method.declaringClass.fPackage != null) {
    subType = CharOperation.compareWith(this.pattern.declaringQualification, method.declaringClass.fPackage.shortReadableName()) == 0;
  }
  int declaringLevel = subType
    ? resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass, method.selector, null, method.declaringClass.qualifiedPackageName(), method.isDefault())
    : resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass);
  return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
}
protected int resolveLevel(MessageSend messageSend) {
org.eclipse.jdt.core.compilerCharOperationcompareWith

Javadoc

Compares the contents of the two arrays array and prefix. Returns
  • zero if the array starts with the prefix contents
  • the difference between the first two characters that are not equal
  • one if array length is lower than the prefix length and that the prefix starts with the array contents.

For example:

  1.  
    array = null 
    prefix = null 
    => result = NullPointerException 
    
  2.  
    array = { 'a', 'b', 'c', 'd', 'e' } 
    prefix = { 'a', 'b', 'c'} 
    => result = 0 
    
  3.  
    array = { 'a', 'b', 'c', 'd', 'e' } 
    prefix = { 'a', 'B', 'c'} 
    => result = 32 
    
  4.  
    array = { 'd', 'b', 'c', 'd', 'e' } 
    prefix = { 'a', 'b', 'c'} 
    => result = 3 
    
  5.  
    array = { 'a', 'b', 'c', 'd', 'e' } 
    prefix = { 'd', 'b', 'c'} 
    => result = -3 
    
  6.  
    array = { 'a', 'a', 'c', 'd', 'e' } 
    prefix = { 'a', 'e', 'c'} 
    => result = -4 
    

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

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Notification (javax.management)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now