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

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

Best Java code snippets using org.eclipse.jdt.core.compiler.CharOperation.subarray (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

/**
 * Checks if the qualified name reference is a problem field binding and have a valid field.
 *
 * @param qualifiedNameReference
 *         Reference which should contains a problem field binding.
 * @return true if the qualified name reference is a valid problem field binding.
 */
static boolean isValidProblemBindingField(QualifiedNameReference qualifiedNameReference) {
  return qualifiedNameReference.binding instanceof ProblemFieldBinding && !((FieldBinding) qualifiedNameReference.binding).declaringClass.isAnonymousType()
      && qualifiedNameReference.tokens.length - 1 == ((FieldBinding) qualifiedNameReference.binding).declaringClass.compoundName.length && CharOperation
      .equals(CharOperation.subarray(qualifiedNameReference.tokens, 0, qualifiedNameReference.tokens.length - 1),
          ((FieldBinding) qualifiedNameReference.binding).declaringClass.compoundName);
}
origin: INRIA/spoon

int lastSlash = CharOperation.lastIndexOf(File.separatorChar, charName);
if (lastSlash != -1) {
  char[] modulePath = CharOperation.subarray(charName, 0, lastSlash);
  compilationUnit.module = CharOperation.subarray(modulePath, lastSlash, modulePath.length);
  pathToModName.put(String.valueOf(modulePath), compilationUnit.module);
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public char[][] getPackageName() {
  int length = this.compoundName.length;
  if (length <= 1) return CharOperation.NO_CHAR_CHAR;
  return CharOperation.subarray(this.compoundName, 0, length - 1);
}
/*
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public char[][] getPackageName() {
  int length = this.compoundName.length;
  if (length <= 1) return CharOperation.NO_CHAR_CHAR;
  return CharOperation.subarray(this.compoundName, 0, length - 1);
}
/*
origin: INRIA/spoon

/**
 * In no classpath mode, when we build a field access, we have a binding typed by ProblemBinding.
 * We try to get all information we can get from this binding.
 *
 * @param qualifiedNameReference
 *         Used to get the problem binding of the field access and the name of the declaring type.
 * @return a field access.
 */
<T> CtFieldAccess<T> createFieldAccessNoClasspath(QualifiedNameReference qualifiedNameReference) {
  boolean fromAssignment = isLhsAssignment(jdtTreeBuilder.getContextBuilder(), qualifiedNameReference);
  CtFieldAccess<T> fieldAccess = createFieldAccess(jdtTreeBuilder.getReferencesBuilder().<T>getVariableReference((ProblemBinding) qualifiedNameReference.binding), null, fromAssignment);
  // In no classpath mode and with qualified name, the type given by JDT is wrong...
  final char[][] declaringClass = CharOperation.subarray(qualifiedNameReference.tokens, 0, qualifiedNameReference.tokens.length - 1);
  final MissingTypeBinding declaringType = jdtTreeBuilder.getContextBuilder().compilationunitdeclaration.scope.environment.createMissingType(null, declaringClass);
  final CtTypeReference<T> declaringRef = jdtTreeBuilder.getReferencesBuilder().getTypeReference(declaringType);
  fieldAccess.getVariable().setDeclaringType(declaringRef);
  fieldAccess.getVariable().setStatic(true);
  fieldAccess.setTarget(jdtTreeBuilder.getFactory().Code().createTypeAccess(declaringRef));
  // In no classpath mode and with qualified name, the binding doesn't have a good name.
  fieldAccess.getVariable()
      .setSimpleName(createQualifiedTypeName(CharOperation.subarray(qualifiedNameReference.tokens, qualifiedNameReference.tokens.length - 1, qualifiedNameReference.tokens.length)));
  return fieldAccess;
}
origin: INRIA/spoon

char[][] packageName = CharOperation.subarray(anImport.getImportName(), 0, anImport.getImportName().length - indexDeclaring);
char[][] className = CharOperation.subarray(anImport.getImportName(), anImport.getImportName().length - indexDeclaring, anImport.getImportName().length - (indexDeclaring - 1));
PackageBinding aPackage;
try {
char[][] chars = CharOperation.subarray(anImport.getImportName(), 0, anImport.getImportName().length - 1);
origin: org.eclipse.jdt/org.eclipse.jdt.core

private char[] erasure(char[] typeName) {
  int genericStart = CharOperation.indexOf(Signature.C_GENERIC_START, typeName);
  if (genericStart > -1)
    typeName = CharOperation.subarray(typeName, 0, genericStart);
  return typeName;
}
public void addConstructorDeclaration(
origin: org.eclipse.tycho/org.eclipse.jdt.core

public void consumeLocalType(char[] uniqueKey) {
  this.signature = new StringBuffer();
  // remove trailing semi-colon as it is added later in comsumeType()
  uniqueKey = CharOperation.subarray(uniqueKey, 0, uniqueKey.length-1);
  if (!this.asBinarySignature)
    CharOperation.replace(uniqueKey, '/', '.');
  this.signature.append(uniqueKey);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * assuming a previously stored start of 's' followed by a call to computeEnd()
 * now retrieve the content between these bounds including trailing angle content
 */
public char[] getFrom(int s) {
  if (this.end == this.bracket) {
    this.end = skipAngleContents(this.bracket);
    this.start = this.end + 1;
  }
  return CharOperation.subarray(this.signature, s, this.end+1);
}
public char[] tail() {
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Returns the souce code to be used for this
 * field's type.
 */
protected char[] getTypeContents() {
  if (isTypeAltered()) {
    return this.fType.toCharArray();
  } else {
    return CharOperation.subarray(this.fDocument, this.fTypeRange[0], this.fTypeRange[1] + 1);
  }
}
/**
origin: org.eclipse.scout.sdk/org.eclipse.scout.sdk.core

@Override
public String getQualifier() {
 char[][] importName = m_astNode.tokens;
 char[][] qualifier = CharOperation.subarray(importName, 0, importName.length - 1);
 return CharOperation.toString(qualifier);
}
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void consumeLocalType(char[] uniqueKey) {
  this.signature = new StringBuffer();
  // remove trailing semi-colon as it is added later in comsumeType()
  uniqueKey = CharOperation.subarray(uniqueKey, 0, uniqueKey.length-1);
  CharOperation.replace(uniqueKey, '/', '.');
  this.signature.append(uniqueKey);
}
origin: org.eclipse.scout.sdk.deps/ecj

private char[] getReturnType(char[] methodSignature) {
  // skip type parameters
  int paren = CharOperation.lastIndexOf(')', methodSignature);
  // there could be thrown exceptions behind, thus scan one type exactly
  return CharOperation.subarray(methodSignature, paren + 1,
      methodSignature.length);
}
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * Returns the souce code to be used for this
 * field's type.
 */
protected char[] getTypeContents() {
  if (isTypeAltered()) {
    return this.fType.toCharArray();
  } else {
    return CharOperation.subarray(this.fDocument, this.fTypeRange[0], this.fTypeRange[1] + 1);
  }
}
/**
origin: INRIA/spoon

} else {
  char[][] packageName = CharOperation.subarray(qualifiedNameReference.tokens, 0, qualifiedNameReference.tokens.length - 1);
  char[][] className = CharOperation.subarray(qualifiedNameReference.tokens, qualifiedNameReference.tokens.length - 1, qualifiedNameReference.tokens.length);
  if (packageName.length > 0) {
    try {
origin: org.eclipse.jdt/org.eclipse.jdt.core

  @Override
  protected void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory, String compliance) {
    char[] name = entryName.toCharArray();
    if (CharOperation.prefixEquals(ClasspathJMod.CLASSES_FOLDER, name)) {
      name = CharOperation.subarray(name, ClasspathJMod.CLASSES_FOLDER.length, name.length);
    }
    super.initRawPackageInfo(rawPackageInfo, new String(name), isDirectory, compliance);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

/**  answer the next type (incl. type arguments), but don't advance any cursors */
public char[] peekFullType() {
  int s = this.start, b = this.bracket, e = this.end;
  int peekEnd = skipAngleContents(computeEnd());
  this.start = s;
  this.bracket = b;
  this.end = e;
  return CharOperation.subarray(this.signature, s, peekEnd+1);
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

private char[] returnClassName(char[] classInfoName, char separator, int mode) {
  if (classInfoName.length == 0) {
    return CharOperation.NO_CHAR;
  } else if (isCompact(mode)) {
    int lastIndexOfSlash = CharOperation.lastIndexOf(separator, classInfoName);
    if (lastIndexOfSlash != -1) {
      return CharOperation.subarray(classInfoName, lastIndexOfSlash + 1, classInfoName.length);
    }
  }
  return classInfoName;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public char[] nextWord() {
  this.end = CharOperation.indexOf(';', this.signature, this.start);
  if (this.bracket <= this.start) // already know it if its > start
    this.bracket = CharOperation.indexOf('<', this.signature, this.start);
  int dot = CharOperation.indexOf('.', this.signature, this.start);
  if (this.bracket > this.start && this.bracket < this.end)
    this.end = this.bracket;
  if (dot > this.start && dot < this.end)
    this.end = dot;
  return CharOperation.subarray(this.signature, this.start, this.start = this.end); // skip word
}
/**  similar to nextWord() but don't stop at '.' */
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public char[] nextWord() {
  this.end = CharOperation.indexOf(';', this.signature, this.start);
  if (this.bracket <= this.start) // already know it if its > start
    this.bracket = CharOperation.indexOf('<', this.signature, this.start);
  int dot = CharOperation.indexOf('.', this.signature, this.start);
  if (this.bracket > this.start && this.bracket < this.end)
    this.end = this.bracket;
  if (dot > this.start && dot < this.end)
    this.end = dot;
  return CharOperation.subarray(this.signature, this.start, this.start = this.end); // skip word
}
public String toString() {
org.eclipse.jdt.core.compilerCharOperationsubarray

Javadoc

Answers a new array which is a copy of the given array starting at the given start and ending at the given end. The given start is inclusive and the given end is exclusive. Answers null if start is greater than end, if start is lower than 0 or if end is greater than the length of the given array. If end equals -1, it is converted to the array length.

For example:
  1.  
    array = { 'a' , 'b' } 
    start = 0 
    end = 1 
    result => { 'a' } 
    
  2.  
    array = { 'a', 'b' } 
    start = 0 
    end = -1 
    result => { 'a' , 'b' } 
    

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
  • 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
  • concat
    Answers the concatenation of the three arrays. It answers null if the three arrays are null. If firs
  • compareTo,
  • concat,
  • fragmentEquals,
  • isWhitespace,
  • match,
  • replaceOnCopy,
  • hashCode,
  • prefixEquals,
  • deepCopy

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JList (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