org.eclipse.jdt.internal.core.util.Util.splitOn()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(265)

本文整理了Java中org.eclipse.jdt.internal.core.util.Util.splitOn()方法的一些代码示例,展示了Util.splitOn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.splitOn()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.core.util.Util
类名称:Util
方法名:splitOn

Util.splitOn介绍

[英]Return a new array which is the split of the given string using the given divider. The given end is exclusive and the given start is inclusive.

For example:

divider = 'b' 
string = "abbaba" 
start = 2 
end = 5 
result => { "", "a", "" }

[中]返回一个新数组,该数组是使用给定除法器对给定字符串的拆分。给定的结束是独占的,给定的开始是包含的。
例如:
1.

divider = 'b' 
string = "abbaba" 
start = 2 
end = 5 
result => { "", "a", "" }

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

pkgName= Util.splitOn('.', qualifiedTypeName, 0, index);
cuName= qualifiedTypeName.substring(index + 1);

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

lastSeparator = entryName.lastIndexOf('/');
String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
String[] existing = null;
int length = pkgName.length;

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory, String sourceLevel, String compliance) {
  int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
  String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
  String[] existing = null;
  int length = pkgName.length;

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory) {
  int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
  String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
  String[] existing = null;
  int length = pkgName.length;

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory) {
  int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
  String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
  String[] existing = null;
  int length = pkgName.length;

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

lastSeparator = entryName.lastIndexOf('/');
String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
String[] existing = null;
int length = pkgName.length;

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private void initRawPackageInfo(HashtableOfArrayToObject rawPackageInfo, String entryName, boolean isDirectory, String compliance) {
  int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
  String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
  String[] existing = null;
  int length = pkgName.length;

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_MODULAR_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_MODULAR_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  switch (token.charAt(0)) {
    case JEM_PACKAGEFRAGMENT:
      String[] pkgName;
      if (memento.hasMoreTokens()) {
        token = memento.nextToken();
        char firstChar = token.charAt(0);
        if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
          pkgName = CharOperation.NO_STRINGS;
        } else {
          pkgName = Util.splitOn('.', token, 0, token.length());
          token = null;
        }
      } else {
        pkgName = CharOperation.NO_STRINGS;
        token = null;
      }
      JavaElement pkg = getPackageFragment(pkgName);
      if (token == null) {
        return pkg.getHandleFromMemento(memento, owner);
      } else {
        return pkg.getHandleFromMemento(token, memento, owner);
      }
  }
  return null;
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

String[] splittedName = Util.splitOn('.', name, 0, name.length());
Object[][] keys = this.packageFragments.keyTable;
for (int i = 0, length = keys.length; i < length; i++) {
String[] splittedName = Util.splitOn('.', name, 0, name.length());
int pkgIndex = this.packageFragments.getIndex(splittedName);
if (pkgIndex != -1) {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

String nameWithoutStar = importDeclaration.getNameWithoutStar();
this.unit.imports[i] = createImportReference(
  Util.splitOn('.', nameWithoutStar, 0, nameWithoutStar.length()),
  sourceImport.getDeclarationSourceStart(),
  sourceImport.getDeclarationSourceEnd(),

相关文章

Util类方法