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

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

本文整理了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:

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

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

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

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  2. switch (token.charAt(0)) {
  3. case JEM_PACKAGEFRAGMENT:
  4. String[] pkgName;
  5. if (memento.hasMoreTokens()) {
  6. token = memento.nextToken();
  7. char firstChar = token.charAt(0);
  8. if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  9. pkgName = CharOperation.NO_STRINGS;
  10. } else {
  11. pkgName = Util.splitOn('.', token, 0, token.length());
  12. token = null;
  13. }
  14. } else {
  15. pkgName = CharOperation.NO_STRINGS;
  16. token = null;
  17. }
  18. JavaElement pkg = getPackageFragment(pkgName);
  19. if (token == null) {
  20. return pkg.getHandleFromMemento(memento, owner);
  21. } else {
  22. return pkg.getHandleFromMemento(token, memento, owner);
  23. }
  24. }
  25. return null;
  26. }
  27. /**

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

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

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

  1. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  2. switch (token.charAt(0)) {
  3. case JEM_PACKAGEFRAGMENT:
  4. String[] pkgName;
  5. if (memento.hasMoreTokens()) {
  6. token = memento.nextToken();
  7. char firstChar = token.charAt(0);
  8. if (firstChar == JEM_CLASSFILE || firstChar == JEM_MODULAR_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  9. pkgName = CharOperation.NO_STRINGS;
  10. } else {
  11. pkgName = Util.splitOn('.', token, 0, token.length());
  12. token = null;
  13. }
  14. } else {
  15. pkgName = CharOperation.NO_STRINGS;
  16. token = null;
  17. }
  18. JavaElement pkg = getPackageFragment(pkgName);
  19. if (token == null) {
  20. return pkg.getHandleFromMemento(memento, owner);
  21. } else {
  22. return pkg.getHandleFromMemento(token, memento, owner);
  23. }
  24. }
  25. return null;
  26. }
  27. /**

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

  1. @Override
  2. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  3. switch (token.charAt(0)) {
  4. case JEM_PACKAGEFRAGMENT:
  5. String[] pkgName;
  6. if (memento.hasMoreTokens()) {
  7. token = memento.nextToken();
  8. char firstChar = token.charAt(0);
  9. if (firstChar == JEM_CLASSFILE || firstChar == JEM_MODULAR_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  10. pkgName = CharOperation.NO_STRINGS;
  11. } else {
  12. pkgName = Util.splitOn('.', token, 0, token.length());
  13. token = null;
  14. }
  15. } else {
  16. pkgName = CharOperation.NO_STRINGS;
  17. token = null;
  18. }
  19. JavaElement pkg = getPackageFragment(pkgName);
  20. if (token == null) {
  21. return pkg.getHandleFromMemento(memento, owner);
  22. } else {
  23. return pkg.getHandleFromMemento(token, memento, owner);
  24. }
  25. }
  26. return null;
  27. }
  28. /**

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

  1. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  2. switch (token.charAt(0)) {
  3. case JEM_PACKAGEFRAGMENT:
  4. String[] pkgName;
  5. if (memento.hasMoreTokens()) {
  6. token = memento.nextToken();
  7. char firstChar = token.charAt(0);
  8. if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  9. pkgName = CharOperation.NO_STRINGS;
  10. } else {
  11. pkgName = Util.splitOn('.', token, 0, token.length());
  12. token = null;
  13. }
  14. } else {
  15. pkgName = CharOperation.NO_STRINGS;
  16. token = null;
  17. }
  18. JavaElement pkg = getPackageFragment(pkgName);
  19. if (token == null) {
  20. return pkg.getHandleFromMemento(memento, owner);
  21. } else {
  22. return pkg.getHandleFromMemento(token, memento, owner);
  23. }
  24. }
  25. return null;
  26. }
  27. /**

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

  1. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  2. switch (token.charAt(0)) {
  3. case JEM_PACKAGEFRAGMENT:
  4. String[] pkgName;
  5. if (memento.hasMoreTokens()) {
  6. token = memento.nextToken();
  7. char firstChar = token.charAt(0);
  8. if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  9. pkgName = CharOperation.NO_STRINGS;
  10. } else {
  11. pkgName = Util.splitOn('.', token, 0, token.length());
  12. token = null;
  13. }
  14. } else {
  15. pkgName = CharOperation.NO_STRINGS;
  16. token = null;
  17. }
  18. JavaElement pkg = getPackageFragment(pkgName);
  19. if (token == null) {
  20. return pkg.getHandleFromMemento(memento, owner);
  21. } else {
  22. return pkg.getHandleFromMemento(token, memento, owner);
  23. }
  24. }
  25. return null;
  26. }
  27. /**

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

  1. public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) {
  2. switch (token.charAt(0)) {
  3. case JEM_PACKAGEFRAGMENT:
  4. String[] pkgName;
  5. if (memento.hasMoreTokens()) {
  6. token = memento.nextToken();
  7. char firstChar = token.charAt(0);
  8. if (firstChar == JEM_CLASSFILE || firstChar == JEM_COMPILATIONUNIT || firstChar == JEM_COUNT) {
  9. pkgName = CharOperation.NO_STRINGS;
  10. } else {
  11. pkgName = Util.splitOn('.', token, 0, token.length());
  12. token = null;
  13. }
  14. } else {
  15. pkgName = CharOperation.NO_STRINGS;
  16. token = null;
  17. }
  18. JavaElement pkg = getPackageFragment(pkgName);
  19. if (token == null) {
  20. return pkg.getHandleFromMemento(memento, owner);
  21. } else {
  22. return pkg.getHandleFromMemento(token, memento, owner);
  23. }
  24. }
  25. return null;
  26. }
  27. /**

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

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

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

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

相关文章

Util类方法